开发者

How to set "SQL_NO_CACHE" default in a pooled mysql JDBC connection

Our mysql server has "SQL_NO_CACHE" off by default, and I wish it off for my application. I can rewrite all my SQL statements but it sound stupid.

According to the mysql docs the per connection default can be configure by the following command.

SET SESSION query_cache_t开发者_运维问答ype = OFF;

I wish this statement will be issues for each new connect created from by DataSource. However, I don't find it is a configurable properties in the connector/j JDBC driver.

DBCP's connectionInitSqls seem to be one of the option, but I am using 1.2.2 for some reason. And I may want to remove the dependency of DBCP (less is more).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜