talking to SphinxQL from java

since a while Sphinx search can be queried not only by their own non-standard interface but also using regular mysql client. they call this feature SphinxQL.

so my work‘s backend no longer has to rely on my own failover code for sphinx – i can leave the dirty details to resin. appserv is already providing resiliency for communication with mysql servers.

but.. it turned out it was not enough to configure database driver pointing to a sphinx server. when i did it i was getting exceptions:

[08:56:11.466] Caused by: java.lang.IllegalArgumentException: Null charset name
[08:56:11.466] at java.nio.charset.Charset.lookup(
[08:56:11.466] at java.nio.charset.Charset.forName(
[08:56:11.466] at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(

so i added at the end of the connection string:


but then i got this:

[09:15:58.498] appserv.ParalellEntitySearcher - problems occured com.mysql.jdbc.PacketTooBigException: Packet for query is too large (26 > -1). You can change this value on the server by setting the max_allowed_packet' variable.
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readPacket(
[09:15:58.498] at com.mysql.jdbc.MysqlIO.getResultSet(
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(
[09:15:58.498] at com.mysql.jdbc.MysqlIO.readAllResults(

so i added this at the end of the connection string:


quite a generous number, probably 1/20th would do a trick too.

maybe someone will find this useful..


Leave a Reply

Your email address will not be published. Required fields are marked *


(Spamcheck Enabled)