JDBC Type 4 Driver 2.0 Programmer's Reference (SQL/MX 2.x)

Writing Unicode data to a CLOB column
The following code illustrates how to write a Unicode data to a CLOB, after obtaining the handle to the
empty CLOB column:
long pos = 0;
// String containing the Unicode data
String s ;
// Obtain the output stream to write Clob data
Writer cw = myClob.setCharacterStream(pos);
// write Clob data using Writer
char[] myClobData = s.toCharArray();
cw.write(myClobData);
Reading CLOB Data
Reading ASCII Data from a CLOB Column
Reading Unicode data from a CLOB Column
Reading ASCII Data from a CLOB Column
To read ASCII or MBCS data from a CLOB column, use the Clob interface or InputStream.
Using the Clob interface:
// Obtain the Clob from ResultSet
Clob myClob = rs.getClob("myClobColumn");
// Obtain the input stream to read Clob data
InputStream is = myClob.getAsciiStream();
// read Clob data using the InputStream
byte[] myClobData;
myClobData = new byte[length];
is.read(myClobData, offset, length);
To read ASCII or MBCS data from the CLOB column by using InputStream:
// obtain the InputStream from ResultSet
InputStream is = rs.getAsciiStream("myClobColumn");
// read Clob data using the InputStream
byte[] myClobData;
myClobData = new byte[length];
is.read(myClobData, offset, length);