permaculture playing cards
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
author & internet detective

Joined: May 26, 2003
Posts: 32508

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: not able to cast like (oracle.sql.CLOB) callableStatement.getClob(int value)
It's not a secret anymore!