Hi Robert,
 
Try Metalink Note:68349.1
The code is for 8i, but works quite well for 9i too.
 
Vadim
 
 -----Original Message-----
From: Robert Foley [mailto:[EMAIL PROTECTED]
Sent: Friday, August 15, 2003 10:26 AM
To: Multiple recipients of list ORACLE-L
Subject: 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 

 

 

 

 
 
 
 

Reply via email to