Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Reading CLOBs with JDBC

Reading CLOBs with JDBC

From: Benjamin Powers <benjamin_powers_at_amsinc.com>
Date: Thu, 23 Sep 1999 17:21:58 -0400
Message-ID: <37EA99F6.3994F949@amsinc.com>


Hello,

I've been trying to do CRUD (Create, Read, Update, Delete) functions with JDBC on table with a CLOB field. I've been able to successfully create rows, update and delete them, but when I try to populate a ResultSet with the data from the table I get:

java.sql.SQLException: ORA-03115: unsupported network datatype or representation

According to the Oracle documentation, I need to upgrade Oracle. I am using Oracle 8.0.5.0.0 and it does support CLOBS. Here is the code that I used to insert and read rows:

(**Java 1.1**)


        java.sql.PreparedStatement stmt = theConnection.prepareStatement("insert into tbl values(?)");

        //***ASRCLOB is a String***

        byte[] bclob = new byte[theASRCLOB.length()];
        bclob = theASRCLOB.getBytes();
        stmt.setBytes(1, bclob);

        //Execute the INSERT statement.
       stmt.executeUpdate();

       //Execute the SELECT statement
        OracleStatement stmt2 =
(OracleStatement)theConnection.createStatement();
        OracleResultSet rs = (OracleResultSet)stmt2.executeQuery("select
theclob from tbl");

Is the problem with my code or my Oracle setup. All things Oracle on my machine were installed from the 8.0.5 CD, so I don't think there should be any version incompatability problems. Thanks in advance for your help.

Benjamin Powers Received on Thu Sep 23 1999 - 16:21:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US