Interface ConnectionFactory

All Known Subinterfaces:
Database
All Known Implementing Classes:
AbstractDatabase

public interface ConnectionFactory
Provides new Connection instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Validates the given connection.
    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(User user) throws DatabaseException
      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 error
      AuthenticationException - in case of an authentication error
    • connectionValid

      boolean connectionValid(Connection connection)
      Validates the given connection.
      Parameters:
      connection - the connection to validate
      Returns:
      true if the connection is valid