- All Known Subinterfaces:
Database
- All Known Implementing Classes:
AbstractDatabase
public interface ConnectionFactory
Provides new
Connection instances.-
Method Summary
Modifier and TypeMethodDescriptionbooleanconnectionValid(Connection connection) Validates the given connection.Creates a connection.createConnection(User user) Creates a connection for the given user.url()Returns the jdbc database url for this connection factory.
-
Method Details
-
url
String url()Returns the jdbc database url for this connection factory.- Returns:
- the jdbc database url for this connection factory.
-
createConnection
Connection createConnection()Creates a connection.- Returns:
- a new JDBC connection
- Throws:
DatabaseException- in case of a connection error
-
createConnection
Creates a connection for the given user.- Parameters:
user- the user for which to create a connection- Returns:
- a new JDBC connection
- Throws:
DatabaseException- in case of a connection errorAuthenticationException- in case of an authentication error
-
connectionValid
Validates the given connection.- Parameters:
connection- the connection to validate- Returns:
- true if the connection is valid
-