In Oracle 12c the CLOB class has been deprecated in ojdbc7.jar. I have a number of instances where I'm using oracle.sql.CLOB.getBufferSize() to transfer data from an InputStream to the CLOB like so:
int size = ((CLOB) emptyClob).getBufferSize();
byte[] cbuffer = new byte[size];
// Read a chunk of data from the input stream, and write the
// chunk into the Clob output stream. Repeat till content has been
// fully read.
int nread = -1;
while ((nread = contentStream.read(cbuffer)) != -1) {
clobWriter.write(cbuffer, 0, nread);
}
The API for the oracle.sql.CLOB class says to use the standard java.sql.Clob, and no that fetching chunks is no longer necessary since it's handled internally. However, it's not clear to me how to implement this, and the JDBC Developers guide doesn't provide any examples.
Can someone provide some sample code that doesn't use the deprecated class?