This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vishnu Murthy
Ranch Hand
Posts: 56
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks
-Vishnu
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishnu,
How do you know that callableStatement.getClob(value) doesn't return null? Have you tried:
System.out.println(callableStatement.getClob(value));

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.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to javaDoc

getClob Method

Returns:
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic