Fork me on GitHub
#sql
<
2017-03-03
>
ccann19:03:46

does anyone know how to insert binary data as a stream via Korma?

ccann19:03:00

the equivalent of

File file = new File("myimage.gif");
FileInputStream fis = new FileInputStream(file);
PreparedStatement ps = conn.prepareStatement("INSERT INTO images VALUES (?, ?)");
ps.setString(1, file.getName());
ps.setBinaryStream(2, fis, file.length());
ps.executeUpdate();
ps.close();
fis.close();