If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Inserting/Updating into CLOB Column in DB2 using Java

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-04, 09:57
sham_suri sham_suri is offline
Registered User
 
Join Date: Sep 2004
Posts: 2
Inserting/Updating into CLOB Column in DB2 using Java

Hi,

I need to insert/update into the clob column in DB2.The data has html tags in it and it is a large data(around 1024kb).The insertion/updation is done using the Java program which is run in AIX platform and the data is inserted/updated into DB2 table(DB2 version 7.1 run on the mainframe system MVS).
Based on the information which i got from web i tried the following options.
1.)Reader inputReader = new StringReader(Stringx);
where Stringx is the String which has the data that needs to be inserted/updated.
The data is inserted/updated dynamically (using dynamic sql) through prepared statement.
PreparedStatement psmt;
psmt.setCharacterStream(int parameterIndex,inputReader,Stringx.length());
psmt.executeUpdate();

2.)byte[] byteArray = Stringx.getBytes();
InputStream inputstream = new ByteArrayInputStream(byteArray);
psmt.setBinaryStream(int parameterIndex,inputstream,Stringx.length());
psmt.executeUpdate();

The above two methods are not working.

3.)Object newObject = Stringx;
psmt.setObject(int parameterIndex,newObject,clobType);
The clobType is got by the select statement.

The setObject() method has limitation in handling the data.It can handle only some volume of data.

Can anyone please tell me how i need to proceed.Is there a limitation in db2 in handling large volume of data as in oracle.Which method i need to follow?.

Can any one please tell me how i need to proceed.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On