Skip to content

ArunPrabhathPA/JDBCConnectionPoolJava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

JDBCConnectionPoolJava

The Java code for JDBC Connection Pool.

Create a connection Pool

There are two overloaded constructors for creating the connections pool

ConnectionPool pool = new ConnectionPool("jdbc:mysql://host:port/dbname","username","password", "divername");

ConnectionPool pool = new ConnectionPool("jdbc:mysql://host:port/dbname","username","password", "divername", poolSize, cleanupInterval);

Getting a connection from the Pool

Connection connection = pool.checkout();

Leave the connection back to the pool

pool.checkin(connection);

We don't need to close the connection, it will automatically close the unused connection and maintain constant number of connections in the pool.

About

The Java code for JDBC Connection Pool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages