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 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
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Error during CLOB update