Reinhard Horn

Ranch Hand
+ Follow
since Jun 04, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Reinhard Horn

Yes,

the error message is

Ambigous call to overloaded method: addValue.

The problem is that this method is not overloaded nor overridden.
Hi,

I am trying to call the following applet method from a javascript function

addValue(long id, int valueX, String month, double[] valuesY) {...}

It works in Firefox and Safari but not in Opera. The problem seems to be the double array param.
Has anyone an idea?

Thanks

Hi Arun,

try to change the type of your input param from ArrayList to List.



Regards
13 years ago
Hi Per-Morten,

can't you put your items in one table and add a year field? It would be simpler.
You select your items with a paramerized query that takes the year as in input param.

Regards
Hi badchip,

SQL is generally misplaced in a JSP. Combine your JSP with a Servlet and a simple Java Bean which
contains an SQL execution method.


Regards
13 years ago
JSP
Hi Jacob,

you could use B as a listener class and register it in class A. So whenever the j-value
in A changes, A fires B's event Method doDf().

public interface AListener {

public void doDf(int j);

}

package javaapplication1;


public class B implements AListener {

public void doDf(int j) {
System.out.println(j);
}



}


package javaapplication1;



import java.util.*;

public class A {



private int j;

private List<AListener> alisteners = new Vector<AListener>();

public List<AListener> getAlisteners() {
return alisteners;
}

public void addAlistener(AListener alistener) {
this.alisteners.add(alistener);
}

public int getJ() {
return j;
}

public void setJ(int j) {
this.j = j;
this.fireJChangedEvent();
}

private void fireJChangedEvent() {
for (AListener alistener : this.getAlisteners()) {
alistener.doDf(this.getJ());
}
}


}


package javaapplication1;

public class TestA {


public static void main(String[] args) {

B b1 = new B();
B b2 = new B();
A a1 = new A();

a1.addAlistener(b1);
a1.addAlistener(b2);
a1.setJ(12);
}

}

Regards
13 years ago
Hi Dikesh,

you only need to kow PL/SQL when you want to work with stored procedures. Stored procedures can be accessed by the CallableStatement class. This will be usesful if you must access legacy code or need high data access performance.

Regards
13 years ago
Hi,

read the specifications (JSR 220) carefully and you are well prepared.

The spec consists of:

ejb-3_0-fr-spec-ejbcore.pdf
ejb-3_0-fr-spec-persistence.pdf
ejb-3_0-fr-spec-simplified.pdf
Hi,

it is explained in the Java language spec, second edition chapter 5.1.3.
This might be the better solution:

javac -classpath /Library/Tomcat/Home/lib/servlet-api.jar:.
-d classes src/com/example/web/BeerSelect.java
src/com/example/model/BeerExpert.java

Must be execute in beerV1.
13 years ago
Ben,

it is the best to simply your steps.

1) make sure that BeerExpert.java is in src/com/example/model
2) make sure that BeerExpert.class is src/com/example/model
3) move to the src directory
4) compile with javac -classpath /Library/Tomcat/Home/lib/servlet-api.jar com/example/model/BeerExpert.java com/example/web/BeerSelect.java
5) move the class files (manually) from the src subdirectories into the classes subdiretories

I tried this successfully. This time with a real Servlet class.

Good luck.
13 years ago
You are right. (See compile Xlint Errors). The class file must be in the wrong directory or not existing.
13 years ago
The errors you get are normal environment errors, meaning there is something wrong with
your directory structure or your file names. It is not a special Servlet problem. The problem would occur also with a "normal" (non Servlet) class. I did not use a servlet class to simplify things. If you want to compile a servlet you must have the servlet jar files in your classpath settings otherwise the complier would not recognize the HttpServlet class.
13 years ago
Yes but I replaced the Servlet class with a normal class. How did you set the classpath of the servlet.jar file and what OS do you use?
13 years ago
Check your directory and file names. Correct spelling, capitalized letters etc..
I get the same errors when I remove BeerExpert.java.
13 years ago