Populating a CLOB
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alexandre_BELLIER
Posted On:   Wednesday, March 6, 2002 08:43 AM

I'm trying to put some data into a CLOB using a java.io.Writer. But an Exception is thrown saying "the line containing the LOB value is not locked" when the program tries to execute the flush() or close() method of the writer. Here is the code i'm using : ps = c.prepareStatement("SELECT LO_TEST_CLOB FROM TEST WHERE ID_TEST=1"); ResultSet rs = ps.executeQuery(); CLOB clob = null; if (rs.next()) clob = (CLOB) rs.getObject(1); char[] data = {'1','2','3','4','5'}; java.io.Writer writer; writer = ((CLOB) clob).getCharacterOutputStream(); writer.write(data); writer.flush(); writer.close(); Does an   More>>

I'm trying to put some data into a CLOB using a java.io.Writer.
But an Exception is thrown saying "the line containing the LOB value is not locked" when the program tries to execute the flush() or close() method of the writer.
Here is the code i'm using :


			
ps = c.prepareStatement("SELECT LO_TEST_CLOB FROM TEST WHERE ID_TEST=1");
ResultSet rs = ps.executeQuery();
CLOB clob = null;

if (rs.next()) clob = (CLOB) rs.getObject(1);
char[] data = {'1','2','3','4','5'};
java.io.Writer writer;

writer = ((CLOB) clob).getCharacterOutputStream();

writer.write(data);
writer.flush();
writer.close();



Does anyone can help me?    <<Less

Re: Populating a CLOB

Posted By:   Christopher_Schultz  
Posted On:   Wednesday, March 6, 2002 10:50 AM

did you mean SELECT FOR UPDATE?
About | Sitemap | Contact