File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes not able to cast like (oracle.sql.CLOB)  callableStatement.getClob(int value) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "not able to cast like (oracle.sql.CLOB)  callableStatement.getClob(int value)" Watch "not able to cast like (oracle.sql.CLOB)  callableStatement.getClob(int value)" New topic

not able to cast like (oracle.sql.CLOB) callableStatement.getClob(int value)

Vishnu Murthy
Ranch Hand

Joined: Jan 04, 2001
Posts: 56
Hi All,
I am working on upgrading my project from Weblogic6.1 to Weblogic9.1 application server.
I am getting null when I cast it like

oracle.sql.CLOB costingClob = (oracle.sql.CLOB) callableStatement.getClob(value);

even though the callableStatement.getClob(value) is returning me an object it is not null.
The same working working fine with Weblogic6.1, it is failing with Weblogic9.1. My database is Oracle8.i.

Can any one please help me.

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30356

How do you know that callableStatement.getClob(value) doesn't return null? Have you tried:

According to Java, casting an object doesn't yield null, so I suspect the stored procedure is returning null in some cases or there is a problem with the driver.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

According to javaDoc

getClob Method

the parameter value as a Clob object in the Java programming language. If the value was SQL NULL, the value null is returned.

what the bold sentence mean ? can you clear me on this.

Thanks in Advance.

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: not able to cast like (oracle.sql.CLOB) callableStatement.getClob(int value)