开发者

How to enable JDBC/MySqlConnectorj connection pooling?

开发者 https://www.devze.com 2023-03-14 23:58 出处:网络
I am still newbish to java development as I am mainly a C# developer. I\'d开发者_JS百科 like to know how to use or enable connection pooling when I do SQL requests from my Java servlet.

I am still newbish to java development as I am mainly a C# developer. I'd开发者_JS百科 like to know how to use or enable connection pooling when I do SQL requests from my Java servlet.

In C# using the MySql connector, it's super simple as it is only a parameter or two to add in the connection string:

Pooling=true; Connection Lifetime=1200;

But how does that work in Java? Is it enabled by default?

I am using the "com.mysql.jdbc.Driver" driver.

Thanks!


Use a connection pool such as c3p0 or Apache Commons DBCP

0

精彩评论

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