Reputation: 1399
I need to specify a custom variable when connecting to MySQL via JDBC from Java code. The session variables can be set like this:
jdbc.url=jdbc:mysql://xxxx.xx.xx.xx/dbName?sessionVariables=group_concat_max_len=204800
Like this doesn't work:
jdbc.url=jdbc:mysql://xxxx.xx.xx.xx/dbName?userVariables=UserId=1
Any ideas?
Upvotes: 1
Views: 453
Reputation: 191
Please read https://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/session-configuration.html.
There is no reference in this source to custom variable. I'm not sure it's possible to specify a custom variable when connecting to MySQL using hibernate.
My idea:
Why not create a servlet (which of course has the URL ability to contain a custom variable) with user variable instead?
Upvotes: 1