Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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
  • 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: 34839
369
Eclipse IDE Java VI Editor
  • 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
  • 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