Hi, I've been trying to support incremental I/O in a Jdbc driver. By forcing the user to access the rowid before the blob, it's possible to use only the JDBC API for loading a Blob: // CREATE TABLE test (data BLOB); INSERT INTO test (data) VALUES (zeroblob(1024)); ResultSet rs = stmt.executeQuery("SELECT rowid, data FROM test"); rs.getRowId(1); final Blob blob = rs.getBlob(2); ... Indeed, with the rowId kept internally by the driver and with the column index (2), I can retrieve all the data needed by 'sqlite3_blob_open': dbName, tblName, colName. I will also support this alternative: PrepareStatement pstmt = c.prepareStatement("SELECT data FROM test where rowid = :rowid"); pstmt.setRowId(1, ...); -- rowId value kept internally ResultSet rs = pstmt.executeQuery(); final Blob blob = rs.getBlob(1);
But for update/insert, it doesn't work because the sqlite3_column_name, sqlite3_column_origin_name, sqlite3_column_table_name and sqlite3_column_database_name can only be used with select: PreparedStatement pstmt = c.prepareStatement("UPDATE test SET data = :blob WHERE rowid = :rowid"); pstmt.setRowId(2, new RowIdImpl(rowid)); pstmt.setBinaryStream(1, new ByteArrayInputStream(new byte[] {1, 2, 3, 4, 5, 6})); -- fails pstmt.executeUpdate(); Do you see a way to write a blob incrementally by using only the JDBC API? (I've checked all the other implementations, but they don't support reading, nor writing...) Thanks. (the driver is here: https://github.com/gwenn/sqlite-jna/tree/master/src/main/java/org/sqlite/driver) _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users