- All Known Subinterfaces:
Database
- All Known Implementing Classes:
AbstractDatabase
public interface ConnectionFactory
Provides new
Connection
instances.-
Method Summary
Modifier and TypeMethodDescriptionboolean
connectionValid
(Connection connection) Validates the given 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
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
-