• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting a CLOB value as a String object

 
Ross Varlese
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i'm trying to get a Clob value called "announcementDb" into a string object for outputting some XSLT tags within java. I'm using the following code as recommended on several sites like java.sun.com:
Clob announcementDb = rset.getClob("announcements");
long len = announcementDb.length();
String announcementOut = announcementDb.getSubString(1, len);
but i'm still getting errors firstly being that the getSubstring doesnt like the data type Long and is looking for an Int. when i replace this with and Int it runs but crashes why I run this query???
any hints would be helpful, cheers.
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's cuz a CLOB can have more data than can fit into a String. You have to cast the long to an int.

Is this what you already tried when you said it 'crashed'? If so, you need to provide more details.
 
Ross Varlese
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've altered the code but i'm still getting an error.
Root cause:
java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getClob

am I missing a driver or something?
 
Neha Ashok
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Root cause:
java.lang.AbstractMethodError: oracle/jdbc/driver/OracleResultSet.getClob()
----------------------------------------------
What is the driver that you are using and servlet engine ?
Hopeful it is classes12.jar and oracle/ Tomcat servlet engine . I've encountered the same error sometimes back. There occurs a conflict between oracle.sql.getClob() and java.sql.getClob() functions. Please check whether classes12.jar contain java.sql package and if any found remove them and package them.
Good Luck
[ January 28, 2003: Message edited by: Subha Ganapathy ]
[ January 28, 2003: Message edited by: Subha Ganapathy ]
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic