尝试从 sqlite 数据库检索存储的图像,但似乎没有任何运气。我的代码:
int i = 0;
while (resultSet.next()) {
InputStream in = resultSet.getBinaryStream(1);
OutputStream f = new FileOutputStream(new File("PeoplesInfo"+i+".jpg"));
i++;
int c = 0;
while ((c = in.read()) > -1) {
f.write(c);
}
f.close();
in.close();
}
我遇到的错误是:
java.sql.SQLException: not implemented by SQLite JDBC driver
at org.sqlite.Unused.unused(Unused.java:29)
at org.sqlite.Unused.getBinaryStream(Unused.java:92)
at Database.main(Database.java:50)
最佳答案
您使用的 SQLite JDBC 实现未实现 getBinaryStream
。
您需要改用 getBytes
方法。
关于java - 从sqlite数据库java中检索图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24806919/