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

Home -> Community -> Usenet -> c.d.o.server -> Deploying a class using Oracle CLOB

Deploying a class using Oracle CLOB

From: nk <nkolman_at_freemail.hu>
Date: 28 Nov 2002 03:07:40 -0800
Message-ID: <b3bd0338.0211280307.60fca3e1@posting.google.com>


I wrote java method that inserts a very long text to a clob field.

  public static void writeClob1() throws SQLException {     StringBuffer s = new StringBuffer();     for (int i = 0; i < 10000; i++) {
      s.append("x");
    }
    OracleCallableStatement cstmt1 = (OracleCallableStatement)

        db.prepareCall ("begin DBMS_LOB.CREATETEMPORARY(?, TRUE, DBMS_LOB.SESSION); end;");

    cstmt1.registerOutParameter (1, OracleTypes.CLOB);     cstmt1.execute ();
    CLOB pCLOB = cstmt1.getCLOB (1);
    pCLOB.putString(1, s.toString());
    PreparedStatement ps = db.prepareStatement("insert into reportout (reportid, reportmessage) values (1, ?)");

    ps.setClob(1, pCLOB);
    ps.executeUpdate();
  }

It works fine when I run it within JDeveloper but when I try to load it to the database I got this error message:

Invoking loadjava on connection 'proba' with arguments: -order -resolve -thin
errors : class PerTestPack/PT

    ORA-29534: referenced object PROBA.oracle/sql/CLOB could not be resolved

    ORA-29545: badly formed class: at offset 42 of PerTestPack.PT.writeClob expecting a class-oracle.sql.CLOB but encountered a class-oracle.sql.CLOB.
at offset 69 of PerTestPack.PT.writeClob1 expecting a class-oracle.sql.CLOB but encountered a class-oracle.sql.CLOB.

The following operations failed

    class PerTestPack/PT: resolution
#### Deployment incomplete. #### 2002.11.28. 11:59:10

Any ideas what can I do? Received on Thu Nov 28 2002 - 05:07:40 CST

Original text of this message

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