-5

我必须将图像插入 matisse 数据库。我如何通过java中的sql insert语句插入它?

4

1 回答 1

0

您可以使用java.sql.PreparedStatement将 ablob插入数据库。

示例代码:

 try{
      Connection con = getYourDatabaseConnection();
      PreparedStatement statement = con.prepareStatement("INSERT INTO YOUR_TABLE(YOUR_BLOB_COLUMN) VALUES (?)";
      statement.setObject(1, yourImage);
      statement.execute();
 } catch(SQLException e){
      e.printStackTrace();
 }
于 2018-04-07T15:33:07.767 回答