This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Error during CLOB update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Error during CLOB update" Watch "Error during CLOB update" New topic
Author

Error during CLOB update

Suresh Kanagalingam
Ranch Hand

Joined: Aug 17, 2001
Posts: 82
Hello all,
I am coding a java program, using JDBC connection, to update CLOB field. I am getting an error when I try to close 'Write' stream and no data is updated in the CLOB field. The code section I have to update the field does not throw an error. So I am assuming that it is writing the data ok using 'write' method, but not commiting it because the close statement is throwing an error. Here is the code below. Can anyone tell me why this is happening?
I am getting error where it says 'outstream.close()'
Thanks
Suresh
===============================

[ Edited by Dave to add code tags ]
[ February 10, 2002: Message edited by: David O'Meara ]
sanjay yermalkar
Greenhorn

Joined: Sep 19, 2001
Posts: 23
Do you have "for update" in your select statement?
I'm pretty sure, It doesn't update it without that.
HTH.
hanumanth reddy
Ranch Hand

Joined: Jun 12, 2000
Posts: 118
and also in addtion to the update statement
dont try to access the resilt set more than once
ie comment out the system.out.println(rs.get ....);


<a href="http://www.jobklub.com" target="_blank" rel="nofollow">http://www.jobklub.com</a><br /> 'Add Job To Life'
Suresh Kanagalingam
Ranch Hand

Joined: Aug 17, 2001
Posts: 82
Hi Sanjay,
I tried with 'FOR UPDATE', but I was getting 'ORA-01002' (fetch out of sequence) error!
Thanks
Suresh
Suresh Kanagalingam
Ranch Hand

Joined: Aug 17, 2001
Posts: 82
Hi Sanjay,
I found the problem with 'ORA-01002'. Db was set to autocommit. I added a line to setAutoCommit(false) and 'ORA-01002' disappeared.
But I still have the previous problem - it is not updating CLOB field - with 'FOR UPDATE' clause.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Error during CLOB update
 
jQuery in Action, 3rd edition