Michael Ardan Michael Ardan - 1 year ago 104
Java Question

Java - ResultSet getString() Inconsistency

I have MySQL Stored Procedure that returns a String using GROUP_CONCAT with around 1200 - 1300 characters. However, when the packet returned in my Java code, the length is reduced to 1023/1024.

I tried to increase the MySQL's max_allowed_packet to 524288000 and group_concat_max_len to 1000000000 but no luck.

Any idea regarding this matter?

Answer Source

Change parameter group_concat_max_len for overcoming this limitation. For that you can use following command

set session group_concat_max_len = 100000;

Please note that this change is session specific ie... temporary. So you have to execute above before your group_concat query.

For your information default value of group_concat_max_len is 1024.

Additional Information

You can also set using following query

set global group_concat_max_len = 100000;

Even if you used that, if you restart mysql you will miss that. If you want to make changes permanent please use following

In mysql configuration file, under [mysqld] add

group_concat_max_len=100000 Then do a restart.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download