Advertisement
joseleonweb

Untitled

May 4th, 2021
711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. try {
  2.   java.sql.Blob blob = oracle.sql.BLOB.createTemporary(
  3. connection, false, oracle.sql.BLOB.DURATION_SESSION);
  4.   OutputStream os = blob.setBinaryStream(1);
  5.   os.write(arrayDeBytes);
  6.      String sql = "insert into taula (imatge) values (?)";
  7.   PreparedStatement stmt = con.prepareStatement(sql);
  8.   stmt.setBlob(1, blob);
  9.   stmt.execute();
  10. } finally {
  11.   blob.free();
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement