Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

"blobSendChunkSize" property does not work (3 replies)

$
0
0
Hi,

My problem is - I only have a "max_allowed_packet" = 1MB on the server. We are somewhat limited in a way that we cannot change this setting on the server. I have a table with a longblob field for which I hope I can store a zipped file. As far as my readings go, we can pass some property values within the DB URL in order to specify our preferred "blobSendChunkSize" property value. And with this property set, the connector should be able to to sent a big file (eg. 8MB) in chunks of 1MB (my "max_allowed_packet" value). Is my understanding correct?

What I don't understand is - why doesn't it seem to work? I still keep on getting "Packet for query is too large." errors. Below is an example of my modified URL:

URL
===
Connection con = DriverManager.getConnection
("jdbc:mysql://localhost:3306/for_testing?blobSendChunkSize=1000000&maxAllowedPacket=1048576", "user", "Password");

After the above line has been executed, I examined the "con" object and it seemed that the properties were not changed.

I tried to set it directly within our class. The new values were persisted but I'm still getting the error upon executing the Prepared Statement. Below is the snippet of my class setting the two properties.

Code
====
if (con instanceof JDBC4Connection){
JDBC4Connection jdbcCon = (JDBC4Connection)con;
jdbcCon.setMaxAllowedPacket(1048576);
jdbcCon.setBlobSendChunkSize("1000000");
}

Questions
=========
1. Am I missing some steps here in order to achieve the goal I wanted?
2. Are there other ways of doing this with due consideration to our limitations?
3. Is this a bug?

Note:
We're using "mysql-connector-java-5.1.21-bin.jar" in our integration.

I'm hoping for your fast reply - I'm stuck with this. Thank you.

- John Balandra

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>