Re: Problem with Connection in ejb method

From: Dave <davidr21_at_hotmail.com>
Date: 19 Mar 2004 10:09:31 -0800
Message-ID: <8244b794.0403191009.5ad36668_at_posting.google.com>


ssashital_at_hotmail.com (Sheetal) wrote in message news:<aa91b983.0403181330.4516941f_at_posting.google.com>...

I would guess your data source is setup incorrectly since it is not returning you a javax.sql.Connection

Dave

> Hi,
>
> 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 Fri Mar 19 2004 - 19:09:31 CET

Original text of this message