JDBC Type 4 Driver 1.1 Programmer's Reference

ps.setAsciiStream(1, inputAsciiStream, length_of_data);
ps.executeUpdate();
The Type 4 driver reads the data from InputStream and writes the data to the LOB table.
The Type 4 driver substitutes the next-available data locator for the parameter of the CLOB
column in the table.
Inserting a Clob Object by Using the setClob Method
Your JDBC application cannot directly instantiate a Clob object. To perform an equivalent
operation:
Obtain a Clob object by using the getClob method of the ResultSet interface.1.
Insert the Clob object into another row by using the setClob method of the
PreparedStatement interface.
2.
In this situation, the Type 4 driver generates a new data locator and, when the
PreparedStatement is executed, copies the contents of the source Clob into the new
Clob object.
Reading CLOB Data
Reading ASCII 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