A little SQL connection pool capable of creating a datasource and improving your database access speed.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
core
LICENSE
README.md
pom.xml

README.md

Prophecy

Prophecy is a simple java SQL Connection pool capable of having multiple connections to enhance database access speed by using more than one connection.

Installation / Usage

  • Install Maven
  • Clone this repo
  • Instal: mvn clean install

Maven dependencies

Client:

<dependency>
    <groupId>de.felix_klauke</groupId>
    <artifactId>prophecy-core</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Example

Creation:

ProphecyConfig config = ProphecyConfig.newBuilder()
        .setDatabaseURL("{URL}")
        .setDatabaseUser("user")
        .setDatabaseUserPassword("password")
        .createProphecyConfig();
        
Prophecy prophecy = ProphecyFactory.createProphecy(config);

Plain old usage:

Connection connection = prophecy.getConnection();
        
// Do whatever you want, query, update...
        
prophecy.checkInConnection(connection);

Using AutoCloseable:

try (Connection connection = prophecy.getConnection()){
    // Do whatever you want
} catch (SQLException e) {
    e.printStackTrace();
}

We also support Datasources:

DataSource dataSource = prophecy.createDatasource();