Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Clob

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using type 1 oracle drivers (JDBC ODBC BRIDGE DRIVER) but i am not able to use rs.getClob(1);

my program is like this

DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
con = con=DriverManager.getConnection("jdbc dbc:jdbcodbc","scott","tiger");
stmt = con.createStatement ();

System.out.println("inserting ur data........");
query1="insert into ttable values ( '" + textfmt + "' )";
stmt.executeUpdate( query1 );

query2 = "select textfmt from ttable";
rs2 = stmt.executeQuery(query2);
while ( rs2.next () ){
Clob clob = rs2.getClob (1);
Reader reader = clob.getCharacterStream();
System.out.println ( "clob: " + clob );
int charValue = 0;
StringBuffer sb = new StringBuffer ();
while ( (charValue = reader.read()) != -1 )
{
sb.append ( (char)charValue );
}// end while
out.println ( "Topic Value: " + sb.toString() );

}



stack trace:


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.UnsupportedOperationException
sun.jdbc.odbc.JdbcOdbcResultSet.getClob(JdbcOdbcResultSet.java:4395)
TextFmt.doPost(TextFmt.java:38)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.




what might be the problem

is this problem with type one drivers
shall i need to use oci or thin drivers for using the CLOB


please reply sooon


thanx in advance


cinux
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by saikrishna cinux:
is this problem with type one drivers

*ding*
Originally posted by saikrishna cinux:
shall i need to use oci or thin drivers for using the CLOB

Yes. That I believe will resolve the problem for you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic