JDBC Driver for SQL/MX Programmer's Reference

// 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 = new byte[length];
int readLen = 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 = new byte[length];
int readLen = is.read(myClobData, offset, length);
Reading Unicode Data from a CLOB Column
You can read Unicode data from the CLOB column by using the Clob interface or Reader.
The following code illustrates how to read the Unicode data from the CLOB column by using
the Clob interface.
// Obtain the Clob from ResultSet
Clob myClob = rs.getClob("myClobColumn");
// Obtain the input stream to read Clob data
Reader cs = myClob.getCharacterStream();
// read Clob data using Reader
char[] myClobData = new char[length];
int readLen = cs.read(myClobData, offset, length);
To read Unicode data from the CLOB column by using a Reader:
// obtain the Reader from ResultSet
Reader cs = rs.getCharacterStream("myClobColumn");
// read Clob data using the InputStream
char[] myClobData = new char[length];
int readLen = cs.read(myClobData, offset, length);