any-database-reader Code
Status: Alpha
Brought to you by:
machitu
File | Date | Author | Commit |
---|---|---|---|
src | 2018-11-17 |
![]() |
[6f9e92] implemented minimumIdle |
CHANGES | 2018-11-17 |
![]() |
[f02271] updated documentation |
LICENSE | 2018-04-14 |
![]() |
[675ee0] added BSD 3-clause license |
README | 2018-11-04 |
![]() |
[1755b5] - corrected idle timeout |
build.copyright | 2018-04-07 |
![]() |
[7aaff0] initial import |
build.properties | 2018-04-07 |
![]() |
[7aaff0] initial import |
build.version | 2018-11-17 |
![]() |
[6f9e92] implemented minimumIdle |
build.xml | 2018-11-03 |
![]() |
[8d9f69] implemented idleTimeout: if a connection has no... |
log4j.properties | 2018-05-06 |
![]() |
[ccbee1] - each database type has its abstractization (p... |
any-database-reader is a Java library that implements a connection pool with query execution facilities. Supported databases: 1. Oracle 2. MySQL 3. PostgreSQL Usage: Only anydatabasereader.* classes are supposed to be used, without subpackages. 1. initialize database pool 1.1. DatabaseConnector.setupDatabaseConnection(String connectionName, String url, String username, String password) 1.2. DatabaseConnector.setupDatabaseConnection(String connectionName, Properties properties) "properties" argument has to contain the keys "url", "username" and "password" 2. execute queries after successful initialization 2.1. DQL queries QueryExecutor.execute(String connectionName, String query) 2.2. DML queries QueryExecutor.executeUpdate(String connectionName, String query) 3. Available configurable parameters for connection pool 3.1. anydatabasereader.pool.idleTimeout = <integer, number of seconds> Maximum number of milliseconds that a client (that's you) will wait for a connection from the pool. If this time is exceeded without a connection becoming available, a SQLException will be thrown. 3.2. anydatabasereader.pool.minimumIdle = <integer> Minimum number of idle connections that any-database-reader lets to linger in the pool. 3.3. anydatabasereader.pool.maximumPoolSize = <integer> Maximum size that the pool is allowed to reach. 3.4. anydatabasereader.pool.maxLifetime = = <integer, number of seconds> Maximum lifetime of a connection in the pool. An in-use connection will never be retired, only when it is closed will it then be removed.