| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> CLOBS work with thin driver?
Hi everyone,
Here is my specs to give some context:
Oracle 9.2.0
Redhat 8.0
java version "1.4.1_01"
JDBC Thin Driver (ojdbc.jar, latest off the web site)
I tried storing/retrieving data from Oracle using CLOBs and it looks like this will not work. Attached is a short example of storing data to a CLOB and later retrieving it. Here is the sample table that I created:
create table test (summary CLOB);
And here is the error I received:
[cgokey_at_cgokey cgokey]$ java md.clients.Test Exception in thread "main"
java.sql.SQLException: Io exception: Connection reset at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
at
oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at md.clients.Test.main(Test.java:33)
I'm trying to store the CLOB using:
st.setCharacterStream(1,new StringReader(summary),summary.length());
st.executeUpdate();
I think this is the right way to do it. I've been told it is also possible to do this with stored procedures, but I'd like to keep my code as database independant as possible and use the method above or some slight variation where I don't have to cast to Oracle classes.
I read somewhere the CLOBS are supported now under the latest Oracle thin driver, am I doing something wrong?
Is there any other data type in Oracle that can store text (<100,000 characters) besides CLOB and LONG. The LONG datatype will not work for me because I have a table with more than one column with LONG.
Any help would be greatly appreciated :)
Chris Received on Fri Feb 14 2003 - 17:24:25 CST
![]() |
![]() |