wood burning stoves 2.0*
The moose likes JDBC and the fly likes Retrieving NCLOB data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Retrieving NCLOB data" Watch "Retrieving NCLOB data" New topic
Author

Retrieving NCLOB data

Kiran Kumar
Ranch Hand

Joined: May 18, 2001
Posts: 107
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.


Thanks<br /> <br />Kiran <br /> <br />SCEA, SCJP 1.4,<br /> <br />"First they ignore u, then they laugh at u, then they fight u, <br />then u will win<br /> <br />Mahatma Gandhi"
 
 
subject: Retrieving NCLOB data