} catch (Throwable e) {
e.printStackTrace();
// do nothing
}
if(throwException){
throw new HibernateException("JDBC connection object must be a oracle.jdbc.OracleConnection " +
"a " + WrappedConnection.class.getName() +
"a " + PoolableConnection.class.getName() +
"or a " + NewProxyConnection.class.getName() +
". Connection class is " + connClassInCurrentClassLoader.getName());
}
}
Method openMethod = getMethod(oracleBlobClass, ORACLE_OPEN_METHOD, Integer.TYPE, null, null);
Field fieldReadWrite = oracleBlobClass.getField(ORACLE_MODE__READWRITE);
arglist = new Object[1];
arglist[0] = fieldReadWrite.get(null); //null is valid because of static field
openMethod.invoke(tempBlob, arglist);
Method getOutputStreamMethod = oracleBlobClass.getDeclaredMethod(ORACLE_GET_BINARY_OUTPUT_STREAM, null);
OutputStream os = (OutputStream) getOutputStreamMethod.invoke(tempBlob, null);
try {
vw.writeValue(os, value);
os.flush();
} finally {
os.close();
}
Method closeMethod = oracleBlobClass.getDeclaredMethod(ORACLE_CLOSE, null);
closeMethod.invoke(tempBlob, null);
statement.setBlob(index, (Blob) tempBlob);
} catch (Exception e) {
throw new HibernateException("Error in oracleNullSafeSet", e);
}
}