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)
I faced a similar problem when I was trying to use Oracle TABs for data insertion through JNDI.
Can some one help me out?