Mybatis在sqlite中处理byte[]数据类型读写困难,如何有效解决?
- 内容介绍
- 文章标签
- 相关推荐
本文共计360个文字,预计阅读时间需要2分钟。
开发环境:Spring Boot + Mybatis Plus场景:在DAO的bean中,当存在byte[]类型时,写入可以成功,但读取不行。错误分析:从错误栈中可以看出,原因是sqlite的driver中,JDBC4ResultSet没有实现以下接口:public Blob
开发环境: springboot + mybatis plus
场景:在DAO的bean中有byte[]类时,写入可以成功,但是读取不行。从错误栈中可以看到原因是:sqlite的driver中,JDBC4ResultSet没有实现以下接口:
public Blob getBlob(int col) throws SQLException { throw unused(); } public Blob getBlob(String col) throws SQLException { throw unused(); }
读写byte[]在JDBC规范中有3种接口:
- InputStream getBinaryStream(int col)
- byte[] getBytes(int col)
- Blob getBlob(int col)
Mybatis Plus默认会选择第3个接口。
本文共计360个文字,预计阅读时间需要2分钟。
开发环境:Spring Boot + Mybatis Plus场景:在DAO的bean中,当存在byte[]类型时,写入可以成功,但读取不行。错误分析:从错误栈中可以看出,原因是sqlite的driver中,JDBC4ResultSet没有实现以下接口:public Blob
开发环境: springboot + mybatis plus
场景:在DAO的bean中有byte[]类时,写入可以成功,但是读取不行。从错误栈中可以看到原因是:sqlite的driver中,JDBC4ResultSet没有实现以下接口:
public Blob getBlob(int col) throws SQLException { throw unused(); } public Blob getBlob(String col) throws SQLException { throw unused(); }
读写byte[]在JDBC规范中有3种接口:
- InputStream getBinaryStream(int col)
- byte[] getBytes(int col)
- Blob getBlob(int col)
Mybatis Plus默认会选择第3个接口。

![Mybatis在sqlite中处理byte[]数据类型读写困难,如何有效解决?](/imgrand/arPRXnPv.webp)