一段代码,仅是写入数据库的一段简单代码,其中有blob字段,分别在两台机器上测试,一台上就没有问题,另一台上报:
javax.servlet.ServletException: oracle.jdbc.driver.ScrollableResultSet.getBlob(Ljava/lang/String;)Ljava/sql/Blob; 检查DB后发现,BLOB数据没有插进去,请教一下这是什么错误?怎样解决?
------解决方法--------------------------------------------------------
你到底是查询还是写数据哦?
------解决方法--------------------------------------------------------
为什么要强制转换?
难道java.sql.ResultSet的功能你觉得还不够拉风?
/** * Retrieves the value of the designated column in the current row * of this <code>ResultSet</code> object as a <code>Blob</code> object * in the Java programming language. * * @param colName the name of the column from which to retrieve the value * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> * value in the specified column * @exception SQLException if a database access error occurs * @since 1.2 */ Blob getBlob(String colName) throws SQLException;/** * Retrieves a stream that can be used to write to the <code>BLOB</code> * value that this <code>Blob</code> object represents. The stream begins * at position <code>pos</code>. * * @param pos the position in the <code>BLOB</code> value at which * to start writing * @return a <code>java.io.OutputStream</code> object to which data can * be written * @exception SQLException if there is an error accessing the * <code>BLOB</code> value * @see #getBinaryStream * @since 1.4 */ java.io.OutputStream setBinaryStream(long pos) throws SQLException;