Retrieving data from NCLOB

From: Kiran <kiri_hk_at_indiatimes.com>
Date: 2 Apr 2003 21:15:22 -0800
Message-ID: <22004ab5.0304022115.4865eae6_at_posting.google.com>



when NCLOB data is retrieved and written to the System.out the data is not being printed properly.
the following is the code i am using.
ResultSet rs = c1.stmt.executeQuery("SELECT NLOBDATA FROM xxxxxx where id = 3353");
while(rs.next())
{
clob = (oracle.sql.CLOB)rs.getClob("NLOBDATA"); System.out.println("clob is " + clob.isNCLOB()); }
java.io.BufferedReader is = new
java.io.BufferedReader(clob.getCharacterStream());

System.out.println("clob data is " + is.readLine());

rs.close();

when i run this code the output is
"?????????????????????????"

Am i doing the right thing here.

in SQL plus if i run the same query i get NLOBDATA as
"ZZZZZZZZZZZZjZ&#9488;ZZZZZZZZZZ"

i also tried using InputStreamReader instead of BufferedReader. but the output is different
"[C_at_8"

i am using DB oracle 9.2.0.1 and JDeveloper 9.0.2.7.97 and also the JDBC driver which comes with the DB 9.2.0.1 is in the classpath.

thanks in advance. Received on Thu Apr 03 2003 - 07:15:22 CEST

Original text of this message