[jboss-user] [JCA/JBoss] - Using CLOB in Serlvet

PrasnnaP do-not-reply at jboss.com
Wed Mar 26 09:53:36 EDT 2008

Hi All,

  We want to use CLOB in servlet. For this we created Oracle 9i Datasouce in -ds.xml file. But we getting ClassCast Exception while we retreiving the WrappedConnection from Datasource connection.

                    DataSource ds = (DataSource) ctx.lookup("java:/OracleDS");
			con = ds.getConnection();//DPDao.getConnection();
	  		System.out.println("Connection class = " + con.getClass().getName());
	  		// This returns "$Proxy55"

	  		// This block is never executed.
	  		if(con instanceof org.jboss.resource.adapter.jdbc.WrappedConnection){
	  			WrappedConnection wc=(WrappedConnection)con;
	  			//with getUnderlying connection method , cast it to Oracle Connection
	  			Connection oracleConnection=wc.getUnderlyingConnection();

Basically we getting Proxy connection when we want to retriev the Oracle underlying connection in our servlet code. 

Thanks in advance !

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138976#4138976

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138976

More information about the jboss-user mailing list