Mathieu
Mathieu

Reputation: 1677

How to enable JDBC/MySqlConnectorj connection pooling?

I am still newbish to java development as I am mainly a C# developer. I'd 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!

Upvotes: 2

Views: 596

Answers (1)

jtoberon
jtoberon

Reputation: 9016

Use a connection pool such as c3p0 or Apache Commons DBCP

Upvotes: 4

Related Questions