File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving NCLOB data

 
Kiran Kumar
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
"ZZZZZZZZZZZZZjZ┐ZZZZZZZZZ"
i also tried using InputStreamReader instead of BufferedReader. but the output is different
"[C@8"

i am using DB oracle 9.2.0.1 and JDeveloper 9.0.2.7.97
thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic