Problem with Connection in ejb method

From: Sheetal <ssashital_at_hotmail.com>
Date: 18 Mar 2004 13:30:44 -0800
Message-ID: <aa91b983.0403181330.4516941f_at_posting.google.com>



Hi,

[Quoted] I'm working on this project which uses DB2 as the database..and I'm using WSAD to design my application with EJBs and Java.

I have a method in a session bean which is:

public boolean isvaliduser(String username, String password) {
Context ctx= new InitialContext;
int valid;
Datasource ds=(Datasource)ctx.lookup("jdbc/eshop"); Connection con=ds.getConnection();
CallableSatement cst= con.prepareCall("?=ValidateUser(?,?)");

cst.setString(1,username);
cst.setString(2,password);
cst.execute();

etc
etc.....

}

I have set up a datasource (jdbc/eshop) in WSAD which connects to the database in DB2..and so I use tht to get the connection....but I am getting an error at the get connection() stmnt..and it says tht

Connection is of the type com.ibm.rmi.iiop.Connection....wheras it shd
be of the type javax,sql.Connection...I don't understand this..
Plz let me know why this is happening......
Thnx in advance...
Sheetal Received on Thu Mar 18 2004 - 22:30:44 CET

Original text of this message