I use websphere connection pooling and had a failure attempting a
CLOB.createTemporary.
tempClob = CLOB.createTemporary(conn, true,
CLOB.DURATION_SESSION);
Here's an excerpt of the exception and stack-trace.
java.lang.ClassCastException:
com.ibm.ejs.cm.proxy.OracleConnectionProxy
at oracle.jdbc.driver.OracleConnection.physicalConnec tionWithin
(OracleConnection.java:5128)
at oracle.sql.CLOB.createTemporary(CLOB.java:1010)
at oracle.sql.CLOB.createTemporary(CLOB.java:956)
I replaced the CLOB.createTemporary statement with the following code.
This worked around the CLOB.createTemporary failing. Hopefully this
helps you if you have the same problem.
CallableStatement stmt = null;
try{
stmt = conn.prepareCall("{ call DBMS_LOB.CREATETEMPORARY(?, TRUE)
}");
stmt.registerOutParameter(1, OracleTypes.CLOB);
stmt.execute();
tempClob = (CLOB)stmt.getObject(1);
...
} finally {
if ( stmt != null ) {
try {stmt.close();} catch (Throwable e) {}
}
}
// Be sure to do a tempClob.freeTemporary() after you're done with
it (i.e., inserted or updated a column with it). |