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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: BLOB question/JDBC

Re: BLOB question/JDBC

From: Jared Still <jkstill_at_cybcon.com>
Date: Fri, 15 Aug 2003 07:39:23 -0800
Message-ID: <F001.005CAEC0.20030815073923@fatcity.com>

Robert,

If someone here knows the answer, they'll be glad to help you.

This list tends to be made up mostly of DBA types, or at least centers mostly on DBA type topics, though some of us take pleasure in telling developers how to do their jobs.

You might try one of the ODTUG lists. You can find them at http://www.odtug.com/subscrib.htm.

A quick check shows that there is an Oracle/Java list there.

Jared

On Fri, 2003-08-15 at 07:26, Robert Foley wrote:
> Hi,
> I'm fairly new to the area of JDBC and Orcale but I was hoping some of you may be able to help me out with this one. I may have the wrong list as its a Java related question. If so could someone please direct me to the correct list.
>
> I'm trying to write a large file into a BLOB column of an Oracle 9I DB, using a set of classes as follows ..
>
> I'm creating a general java.sql.Connection as follows ...
>
> dbUrl = "jdbc:" + dbProtocol + ":thin:@" + dbHost + ":" +dbPort + ":" + dbName;
>
> Class.forName(oracle.jdbc.driver.OracleDriver);
>
> return DriverManager.getConnection(dbUrl, dbUser, dbPass);
>
>
>
> So I'm returning from here with a normal java.sql.Connection.
>
> Then I'm creating a the BLOB as follows ...
>
> oracle.sql.BLOB dataFile = new BLOB((OracleConnection) con, dataAsBytes);
>
> Note here that I am casting the java.sql.Connection to an OracleConnection and passing this as an argument. Why does the connection need to be passed as an argument here ??
>
> I am then using a PreparedStatement to send the BLOB to the DB.
>
> stmt.setBlob(1,dataFile);
>
>
> stmt.setString(2,time.toString());
>
> stmt.setLong(3,time.getTimeInMillis());
>
> stmt.executeUpdate();
>
> stmt.close();
>
> con.close();
>
> My problem is that I keep getting the following exception ....
>
> java.sql.SQLException: ORA-24813: cannot send or receive an unsupported LOB
>
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>
> at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
>
> at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
>
> at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
>
> at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1094)
>
> at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2132)
>
> at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2015)
>
> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2877)
>
> at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
>
> at com.changingworlds.nav.updatemanager.database.DatabaseManager.addToHistoryDB(DatabaseManager.java:138)
>
>
>
> I've been looking all over for a solution to this exception and I'm finding that its usually caused when I am using the different versions of oracle on server and client.
>
> I don't understand this because I am using the correct oracle9i drivers.
>
> I hope somebody can help me with this as I'm really stuck.
>
> Yours sincerely,
>
>
>
> Robert Foley
>
>
>
>
>
>
>
>
>
>
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jared Still
  INET: jkstill_at_cybcon.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Aug 15 2003 - 10:39:23 CDT

Original text of this message

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