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).
精彩评论