Support for getBlob/setBlob

Abierto
#622 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java, sqlite
Área
database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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).

Lenguaje dominante
Java
Estrellas
3.3k
Forks
676
Merge medio
1 d 15 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xerial/sqlite-jdbc

Todos los issues de xerial/sqlite-jdbc

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.