users@glassfish.java.net

Re: Typecast prob with the com.sun.jdbc40.connectionholder to wsjdbcconnection

From: <glassfish_at_javadesktop.org>
Date: Tue, 31 Aug 2010 04:49:07 PDT

Hi friends,

Initial Context ctx = new InitialContext();
(com.sun.appserv.jdbc.datasource)ds= (com.sun.appserv.datasource)ctx.lookup("jdbc/login");
Connection con = ds.getConnection();------> connection holder connection
Connection ton = ds.getConnection(con);-----------> I got oracle connection here and I check it out (it returns oracle connection)....................

but when I try to cast this oracle connection to wsjdbcconnection like this...

connection cn = (connection)WsJdbc.getconnection((WsJdbcConnection)ton);---> it throws an error "Cannot cast oracle connection to wsjdbc connection"
[Message sent by forum member 'balaji45678']

http://forums.java.net/jive/thread.jspa?messageID=481335