PreparedStatement存储BLOB属性字段

来源:互联网 发布:儿童学编程的害处 编辑:程序博客网 时间:2024/06/05 17:59
严重: Servlet.service() for servlet [springMVC] in context with path [/artemis] threw exception [Handler processing failed; nested exception is java.lang.AbstractMethodError: org.apache.commons.dbcp.DelegatingPreparedStatement.setBlob(ILjava/io/InputStream;J)V] with root cause

java.lang.AbstractMethodError: org.apache.commons.dbcp.DelegatingPreparedStatement.setBlob(ILjava/io/InputStream;J)V


数据库字段为BLOB类型时,PreparedStatement的setBytes(parameterIndex, byte[] )和setBinaryStream(parameterIndex,inputStream,length)

注意:length为文件长度或byte[]长度

都可以存储。

0 0
原创粉丝点击