inserting byte array into blob column

前端 未结 1 749
半阙折子戏
半阙折子戏 2020-12-19 19:25

I\'m trying to insert byte array into a blob column in sqlite database. I\'ve tried with both setBinaryStream and setBytes, but I\'m getting not implemented by SQLite JDBC d

相关标签:
1条回答
  • 2020-12-19 19:45

    Once a PreparedStatement object has been created with

    String sql = "INSERT INTO ...";
    PreparedStatement stm = c.prepareStatement(sql);
    

    the object has already processed the sql command text. When the time comes to execute the PreparedStatement all we need to do is

    stm.executeUpdate();
    

    (The method call executeUpdate(sql) is intended to be used with Statement objects, not PreparedStatement objects.)

    0 讨论(0)
提交回复
热议问题