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.
Joined: Apr 23, 2002
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.
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 ]