Hello,

I'm trying to upload an image into an 'bytea' type colum of postgres.
How do i convert the java.io.FileInputStream of the upload into a BinaryStream 
datatype accepted by the database.

I tried that code below, but it didn't work.

importPackage(java.sql);
var ps= new PreparedStatement(conn.prepareStatement("INSERT INTO my_table(id,image)  
VALUES (?,?)"));
ps.setString(1,id);                         
ps.setBinaryStream(2,my_file_io_stream,my_file_size);
ps.executeUpdate();
ps.close();

-> <flow.log>
error instantiating (WrappedException of org.mozilla.javascript.JavaScriptException: 
method not implemented.): class java.sql.PreparedStatement is interface or abstract

or can I use 
convert, setColumn etc.  from  org.apache.cocoon.util.JDBCTypeConversions ??

(I'm using cocoon 2.1.4 dev)

Regards jörn

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to