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 -> Re: problems with LONGVARCHAR in JDBC Oracle driver...

Re: problems with LONGVARCHAR in JDBC Oracle driver...

From: <seetharaman.n_at_usa.net>
Date: Mon, 17 May 1999 14:52:39 GMT
Message-ID: <7hpafn$h10$1@nnrp1.deja.com>


In article <373F0834.2AB8_at_cs.ucl.ac.uk>,   Richard Wheeldon <R.Wheeldon_at_cs.ucl.ac.uk> wrote:

> Could you or someone else please summarise these probs for me, so
> I know to avoid them,
>

Sure!

The environment



Oracle 7.3.4
JDK 1.1.6
NT 4.0 servicepack3
Oracle JDBC thin/oci driver for JDK 1.1.1 (the latest that was available on the Oracle site)

The problem



Inserting LONG and LONG RAW fields of more than 32k using Oracle stored procedures and JDBC's CallableStatement resulted in NullPointerException

The error message I get is:
java.lang.NullPointerException

        at oracle.jdbc.ttc7.TTIMsg.marshalCLR(Compiled Code)
        at oracle.jdbc.ttc7.TTIrxd.putColumnValue

(TTIrxd.java:359) at oracle.jdbc.ttc7.TTIrxd.marshalPLSQLArgs
(Compiled Code) at oracle.jdbc.ttc7.TTIrxd.marshal(Compiled
Code) at oracle.jdbc.ttc7.TTIiov.processRXD(TTIiov.java:199) at oracle.jdbc.ttc7.Oall7.receive(Compiled Code) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(Compiled Code) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch

(TTC7Protocol.java:661

)

        at oracle.jdbc.driver.OracleStatement.doExecuteOther
(OracleStatement.jav

a:780)

        at oracle.jdbc.driver.OracleStatement.doExecuteWithBatch
(OracleStatement

.java:822)

        at oracle.jdbc.driver.OracleStatement.doExecute(Compiled
Code)         at

oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (Compiled Code )

        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery
(OraclePreparedStatement.java:60)

The solution:



Replace JDBC's CallableStatement with JDBC's PreparedStatement. This works for both thin and oci Oracle JDBC drivers. I had initially thought the problem was with the thin driver, but that's not so...

Reason why CallableStatement fails



beats me! Is this a documented bug???

situ

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Mon May 17 1999 - 09:52:39 CDT

Original text of this message

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