0

Trying to retrieve stored images from sqlite database but don't seem to be having any luck. My code:

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();
}

The errors which i'm getting are:

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)

1 Answer 1

2

The SQLite JDBC implementation you're using doesn't implement getBinaryStream.

You'll need to use the getBytes method instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.