File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Help with updating CLOB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Help with updating CLOB" Watch "Help with updating CLOB" New topic
Author

Help with updating CLOB

Vladan Radovanovic
Ranch Hand

Joined: Mar 20, 2000
Posts: 216
Hi everyone. Maybe someone can help me. The issue here is that I am getting class cast exception when trying to update a clob. This code was working perfectly with OC4J but we have just switched to OC4J Release 2 and it's suddenly failing. The exception is:java.lang.ClassCastException: com.evermind.sql.OrclResultSet and it happens when I select the CLOB for update and try to cast ResultSet to Oracle Result Set (oracle.sql.CLOB clob = ((OracleResultSet)rset).getCLOB(1); ) :

I will look for the solution but any pointer in the meantime is appreciated!
Thanks
[ September 27, 2002: Message edited by: Vladan Radovanovic ]
Vladan Radovanovic
Ranch Hand

Joined: Mar 20, 2000
Posts: 216
Thanks to anyone that looked into this topic
Still don't know why is that line giving me trouble. Anyway, changed it to:
oracle.sql.CLOB clob = (oracle.sql.CLOB)rset.getObject (1);
and it works now
John Carnell
Author
Ranch Hand

Joined: Sep 27, 2002
Posts: 71
Hi Vladan,
The problem is not you. Oracle has never properly implemented the CLOB APIs for the Standard JDBC API. We ran into a similar problem at a client site and they only way we worked around it was to Oracle Classes (like you did) instead of the standard JDBC inteface.
Thanks,
John


John Carnell<br />Principal Architect<br /> <br />Netchange, LLC<br />1161 HillCrest Heights<br />Green Bay, WI 54313<br /> <br />john.carnell@netchange.us<br /> <br /> <br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/159059228X/ref=jranch-20" target="_blank" rel="nofollow">Pro Jakarta Struts, Second Edition</a>
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help with updating CLOB
 
Similar Threads
Use two connections individually for a clob selection and updating statment.
BLOB
Problem in inserting large file in CLOB in Oracle
Question on update CLOB column when the column value is null
an example to insert data into Oracle Clob