[jboss-user] [JNDI/Naming/Network] - Insert CLOB or BLOB in oracle 10g with JNDI , giving ClassCa

rajesh.12220 do-not-reply at jboss.com
Mon Mar 2 12:58:01 EST 2009


Hi 

I am getting an ClassCastException,while inserting an String(a XML) as a CLOB to oracle10g database using Jboss server.
I am using a JNDI ,and getting an connection,trying to use psNew.setStringForClob method of OraclePreparedStatement giving an error as follows :
Connection name  ---> 2org.jboss.resource.adapter.jdbc.WrappedConnection
java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrappedPreparedStatement cannot be cast to oracle.jdbc.OraclePreparedStatement

Code is  :
------------------
con = getConnection();

if (con != null) {
                        System.out.println(" Connection name  ---> 2" + con.getClass().getName());
                        String query = "INSERT INTO HR_USERS VALUES (?, ?, ?)";
                        psNew = (OraclePreparedStatement)con.prepareStatement(query);
                        
                        psNew.setString(1,"John" );
                        psNew.setString(2, transDto.getAgentVersion());
                        psNew.setStringForClob(3, dto.getIncomingXml());
                        psNew.executeUpdate();

please suggest the error or guide for a new method to insert CLOB to oracle 10g using jndi (Jboss server)

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

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



More information about the jboss-user mailing list