Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> BLOB question/JDBC
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: Robert Foley
INET: robert.foley_at_changingworlds.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 - 09:26:24 CDT
![]() |
![]() |