The driver documentation talks about "sessionVariables" that might be
possible to pass through the connection URL:
https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html

Alternatively, there might be a way to configure driver via JNDI and
set some variables that way.

I haven't tested either though.

Regards,
   Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/


On 20 April 2016 at 23:49, Shawn Heisey <apa...@elyograg.org> wrote:
> On 4/20/2016 6:01 AM, Zaccheo Bagnati wrote:
>> I configured an ImportHandler on a MySQL table using jdbc driver. I'm
>> wondering if is possible to set a session variable in the mysql connection
>> before executing queries. e. g. "SET SESSION group_concat_max_len =
>> 1000000;"
>
> Normally the MySQL JDBC driver will not allow you to send more than one
> SQL statement in a single request -- this is to prevent SQL injection
> attacks.
>
> I think MySQL probably has a JDBC parameter that would allow multiple
> statements per request, but a better option might be to put all the
> statements you need in a stored procedure and call the procedure from
> the import handler.  You'll need to consult MySQL support resources for
> help with how to do this.
>
> Thanks,
> Shawn
>

Reply via email to