Reading from CLOB in java through JDBC

Here is a code snippet that I have used to read from a CLOB, Oracle 10g instance.

PreparedStatment ps = connection.prepareStatement
("SELECT clobcolumn from clobtable");
ResultSet rs = ps.executeQuery();
oracle.sql.CLOB clobValue = (oracle.sql.CLOB)rs.getCLOB(1);
BufferedReader reader = new BufferedReader(new
String read = null;
StringBuffer buffer = new StringBuffer();
while((read = reader.readLine()) != null )
Digg This

Author: Phani Kumar

Developer, selftaught photographer, and a gadget lover, loves learning new things.

1 thought on “Reading from CLOB in java through JDBC”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s