File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Java Products and Servers and the fly likes Cannot create CLOB.createTemporary() in Sun One server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Cannot create CLOB.createTemporary() in Sun One server" Watch "Cannot create CLOB.createTemporary() in Sun One server" New topic

Cannot create CLOB.createTemporary() in Sun One server

Sheenu Pillai

Joined: Jul 25, 2002
Posts: 15
I am trying to insert a Clob data into Oracle (9i) using thin driver. I used the sample code Oracle had suggested to insert Clob data (by creating temporary memory supplied by the driver). As a standalone program it works fine but when I deploy it to Sun One, it gives me a NullPointer exception in CLOB.createTemporary() method. The only difference I can see is, the database connnection used in standalone was Oracle.jdbc.driver.OracleConnection and that of the server was com.sun.enterprise.resource.JdbcXAConnection. Would this be an issue ? If so is their a work around ?
ma rege

Joined: Jun 21, 2004
Posts: 1
Did u get solution?

I am facing same problem
Naidu Jitta

Joined: May 12, 2003
Posts: 14
createTemporary expects an OracleConnection whereas from datasource we get a lite wrapper around OracleConnection. We need to navigate through the wrappers to get to the physical OracleConnection.
Abrar Bin Yousuf

Joined: Oct 08, 2004
Posts: 6
Since you are using oracle specific calls you would need to use their API calls.

You can check more details at:
Julian Eduardo de Anquin

Joined: Nov 28, 2003
Posts: 8
Hi i've been arround with the same error and i've found the workarround.
BLOB tempBlob = BLOB.createTemporary(unwrappConnection(), true,BLOB.DURATION_CALL);
and the unwrappConnection() method
private OracleConnection unwrappConnection() throws SQLException {
org.jboss.resource.adapter.jdbc.WrappedConnection oWConn = (WrappedConnection) oConn;
return (OracleConnection) oWConn.getUnderlyingConnection();
and oConn is the connection taken from the datasource.
Hope this helps
Julian de Anquin
subject: Cannot create CLOB.createTemporary() in Sun One server
It's not a secret anymore!