It is harder than I thought....
Another try:
Code:
MapSqlParameterSource inParams = new MapSqlParameterSource();
inParams.addValue("a_id", foo.getA_Id());
inParams.addValue("data", new SerialBlob(foo.getData()));
This gives ORA-17004 "Invalid column type".
If I add:
Code:
inParams.registerSqlType("data", Types.BLOB);
I get:
ClassCastException: javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB
Next try:
Code:
...
Blob blob;
blob = m_dataSource.getConnection().createBlob();
blob.setBytes(1, foo.getData());
inParams.addValue("data", blob);
inParams.registerSqlType("data", Types.BLOB);
...
Result:
ORA-22922: nonexistent LOB value
Without the registerSqlType() I get the 17004 error again.