Performance issue with JDBC Oracle BLOB insert !
Hi All,
I'm facing a peroformance issue in inserting BLOB data in Oracle db using standard jdbc. Here's a code snippet I'm using :
File binaryFile = new File(fileName);
InputStream is = new FileInputStream(fileName);
insertSql = "INSERT INTO JMS_MESSAGE_TEST ( JMS_MESSAGE_KEY, JMS_MESSAGE_TEXT )" +" VALUES(?,?)";
System.out.println(" sql..."+insertSql);
stmt = con.prepareStatement(insertSql);
stmt.setString(1,jmsKey);
stmt.setBinaryStream(2,is,(int)binaryFile.length());
stmt.executeUpdate();
is.close();
This method is inserting a filesize of 4 mb in 22 sec (excluding the db connection time). Is there anyway to improve performance, for our current req, 22 sec is way high. I'm using OCI driver.
I've tried couple of other ways of inserting BLOB data, for eg. inserting a EMPTY_BLOB and then use Select on UPDATE to write the stream.
Any pointer on this will be highly appreciated.
Thanks,
Shamik

