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