Re: "blobSendChunkSize" property does not work
I've tried using ServerPreparedStatement but I'm getting a similar error.
"Parameter of prepared statement which is set through mysql_send_long_data() is longer than 'max_long_data_size' bytes"
CODE
====
File file = new File("C:\\software\\apache-ant-1.8.3-bin.zip");
FileInputStream in = new FileInputStream(file);
DriverManager.registerDriver(new com.mysql.jdbc.Driver());
java.sql.Connection con = DriverManager.getConnection
("jdbc:mysql://localhost:3306/for_testing?useServerPrepStmts=true&blobSendChunkSize=50000&maxAllowedPacket=20000000", "root", "Passw0rd");
String query = "insert into blob_table values(?)";
com.mysql.jdbc.Connection conn = (com.mysql.jdbc.Connection)con;
conn.setBlobSendChunkSize("50000");
PreparedStatement pstmt = conn.serverPrepareStatement(query);
pstmt.setBinaryStream(1, (InputStream) in, (int) file.length());
pstmt.execute();
System.out.println("OK");
Why is it failing? can somebody please help me modify my sample code?
Subject
Written By
Posted
Re: "blobSendChunkSize" property does not work
October 15, 2012 10:19PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.