aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
Author

Cannot create CLOB.createTemporary() in Sun One server

Sheenu Pillai
Greenhorn

Joined: Jul 25, 2002
Posts: 15
Hi,
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 ?
Thanks,
Srini
ma rege
Greenhorn

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

I am facing same problem
Naidu Jitta
Greenhorn

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
Greenhorn

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:
http://swforum.sun.com/jive/thread.jspa?forumID=114&threadID=22440
Julian Eduardo de Anquin
Greenhorn

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot create CLOB.createTemporary() in Sun One server
 
Similar Threads
java.lang.ClassCastException: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast
Using CLOBs with JPA
CLOB with Oracle thin driver
How to use oracle 9.2 driver for oracle817's CLOB?
Convert large string to Clob