File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot create CLOB.createTemporary() in Sun One server

 
Sheenu Pillai
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did u get solution?

I am facing same problem
 
Naidu Jitta
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic