Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kigsmtua/connectionpooling
https://github.com/kigsmtua/connectionpooling
connection-pooling databases mysql singleton
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kigsmtua/connectionpooling
- Owner: kigsmtua
- Created: 2017-10-02T09:32:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-02T09:36:46.000Z (over 7 years ago)
- Last Synced: 2024-10-06T12:42:07.312Z (3 months ago)
- Topics: connection-pooling, databases, mysql, singleton
- Language: Java
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ConnectionPooling
Connection pooling on a mysql database in java (Future versions will aim to make it generic to support major databases)# How to use
```java
import com.pooling.connectionpooling.Pooling
class TestConnection(){
private transient pooling;
public TestConnection(){
try(pooling = new Pooling('host','port','dbname','dbusername','dbpassword','poolname',poolsize)){
//Do some other things you want to do at this point
}catch (ClassNotFoundException | InstantiationException |
IllegalAccessException | SQLException ex) {
///Maybe some logs at this point
///Whatever have you here
System.exit(1);
}
}
}
```
And in the spirit of reusing the pool , just ensure the class is instantiated only once