Note that there are some explanatory texts on larger screens.

plurals
  1. POInsert file in blob field with jaybird 2.1.6
    primarykey
    data
    text
    <p>Good morning evrybody,</p> <p>I'm trying to insert a file in a blob field in a Firebird database using lib jaybird 2.1.6.</p> <p>First, I create a record in my database, then, with the id of record, I try to insert my file in a blob (subtype 0) field. Here is my code:</p> <pre><code> public static boolean insertBlob(File p_file, String p_maxId) { String requette = "UPDATE MAIL_RECU a SET a.CONTENU=? where a.ID_MESSAGE_RECU="+ p_maxId; PreparedStatement ps = null; FileInputStream input = null; try { ps = laConnexion.prepareStatement(requette); input = new FileInputStream(p_file); int paramIdx = 1; ps.setBinaryStream(paramIdx++, input, p_file.length()); ps.executeUpdate(); } catch (SQLException e) { System.out.println("cause: " + e.getCause()); System.out.println("stacktrace: " + e.getStackTrace()); System.out.println(e); messageUtilisateur.affMessageException(e, "Erreur à l'insertion d'un blob"); } catch (FileNotFoundException e) { messageUtilisateur.affMessageException(e, "impossible de trouver le fichier"); } finally { try { ps.close(); input.close(); } catch (SQLException e) { messageUtilisateur.affMessageException(e, "Erreur à l'insertion d'un blob"); } catch (IOException e) { messageUtilisateur.affMessageException(e, "fichier non trouvé"); } } return true; } </code></pre> <p>The problem is I have an exception when ps.setBinaryStream(paramIdx++, input, p_file.length()); is executed. I have a message "java.sql.SQLException: not yet implemented". My question is, is anyone have arlready have this problem? If yes, how did he (or she) fix it? Is there another way to store file in blob with jaybird?</p> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload