c3p0 icon indicating copy to clipboard operation
c3p0 copied to clipboard

Unexpected sql_mode when using c3p0

Open ks-zealot opened this issue 7 years ago • 0 comments

I my application I have old legacy hand-written connection pool. Now I try to migrate code to c3p0. In Mysql I set sql_mode to NO_ENGINE_SUBSTITUTION and exactly this sql_mode I get when use connection. Here is snippet I use to check sql_mode

ResultSet rs = connection.prepareStatement("Select @@sql_mode").executeQuery();
rs.next();
Object o =  rs.getObject(1);
System.out.println(o);

Output is NO_ENGINE_SUBSTITUTION. But, when I use c3p0, I get following result

STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION

So, could you tell me please, why? I how can I fix sql_mode?

ks-zealot avatar Mar 23 '18 14:03 ks-zealot