Support for getBlob/setBlob

Aperta
#622 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, sqlite
Ambito
database

Direzione di ricerca

Start by reading the JDBC driver’s implementations of PreparedStatement.setBlob and setBinaryStream, then check the relevant tests for prepared statement parameter binding. The issue shows both calls fail with unsupported-operation errors in version 3.36.0; done means adding support for binding image bytes as a BLOB and covering the supported calls with tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement:JDBC impacts:JNI

I'm trying to put BLOBs of images to a database and I receive errors after executing the following code:

PreparedStatement ps = DriverManager.getConnection("jdbc:sqlite:" + databasePath).prepareStatement("UPDATE users SET picture = ? WHERE id = 1;");
ps.setBlob(1, new SerialBlob(Files.readAllBytes(Paths.get(imagePath))));

This resulted in a java.sql.SQLException with the message: "not implemented by SQLite JDBC driver", pointing to the line with ps.setBlob(...);
I replaced that line with ps.setBinaryStream(1, Files.newInputStream(Paths.get(imagePath))); and a java.sql.SQLFeatureNotSupportedException was thrown, pointing to the same line in the stack trace.

I am using the most recent version as of now (3.36.0).

Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.