
Hi Enrique, On 09-09-2011 06:44:05 -0700, elarios wrote:
Please, I would like to know the correct sintaxis for calling a stored procedures in MonetDB from a Java application. I was using some code that works fine in MySQL but this doesn't work in MonetDB. The code inside a method is:
------------------------------------------------------------------- Connection con = null; ResultSet rs = null; CallableStatement cs = null;
cs = con.prepareCall("{call hts.spInsertFile(?)}");
This looks like JDBC escape syntax. We don't support this (yet) for performance reasons. We don't support CallableStatements either.
File fl = new File("/home//Test/example.pdf"); imgfile = new FileInputStream(fl);
cs.setBinaryStream(1,imgfile);
Datastreams are currently not supported by the database backend. These things have to be serialised, and written as block.
rs = cs.executeQuery();
In general we disadvice people to insert binary blobs in the database. If you really want to insert binary files in the database, make sure you use a blob, and that you use the PreparedStatement's setBytes() method.