public final class DatabaseConnections
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static DatabaseConnectionProvider |
connectionProvider(Database database,
User user)
Instantiates a default DatabaseConnectionProvider instance
|
static DatabaseConnectionProvider |
connectionProvider(Database database,
User user,
int validityCheckTimeout)
Instantiates a default DatabaseConnectionProvider instance
|
static DatabaseConnection |
createConnection(Database database,
java.sql.Connection connection)
Constructs a new DatabaseConnection instance, based on the given Connection object.
|
static DatabaseConnection |
createConnection(Database database,
java.sql.Connection connection,
int validityCheckTimeout)
Constructs a new DatabaseConnection instance, based on the given Connection object.
|
static DatabaseConnection |
createConnection(Database database,
User user)
Constructs a new DatabaseConnection instance, based on the given Database and User
|
static DatabaseConnection |
createConnection(Database database,
User user,
int validityCheckTimeout)
Constructs a new DatabaseConnection instance, based on the given Database and User
|
public static DatabaseConnection createConnection(Database database, User user) throws DatabaseException
database
- the databaseuser
- the user for the db-connectionDatabaseException
- in case there is a problem connecting to the databasepublic static DatabaseConnection createConnection(Database database, User user, int validityCheckTimeout) throws DatabaseException
database
- the databaseuser
- the user for the db-connectionvalidityCheckTimeout
- the number of seconds specified when checking if the connection is validDatabaseException
- in case there is a problem connecting to the databaseAuthenticationException
- in case of an authentication errorpublic static DatabaseConnection createConnection(Database database, java.sql.Connection connection) throws DatabaseException
database
- the databaseconnection
- the Connection object to base this DatabaseConnection onDatabaseException
- in case there is a problem connecting to the databasepublic static DatabaseConnection createConnection(Database database, java.sql.Connection connection, int validityCheckTimeout) throws DatabaseException
database
- the databaseconnection
- the Connection object to base this DatabaseConnection on, it is assumed to be in a valid statevalidityCheckTimeout
- the number of seconds specified when checking if the connection is validDatabaseException
- in case there is a problem connecting to the databasepublic static DatabaseConnectionProvider connectionProvider(Database database, User user)
database
- the underlying databaseuser
- the userpublic static DatabaseConnectionProvider connectionProvider(Database database, User user, int validityCheckTimeout)
database
- the underlying databaseuser
- the uservalidityCheckTimeout
- the number of seconds specified when checking if a connection is valid