Interface JdbcConnectionPool

All Superinterfaces:
All Known Subinterfaces:
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JdbcConnectionPool extends NamedService
JDBC connection pool.
  • Field Details

  • Method Details

    • create

      static JdbcConnectionPool create(Config config)
      Create a JDBC connection pool from provided configuration.
      Optional configuration parameters
      key default value description
      url   JDBC URL of the database - this property is required when only configuration is used. Example: jdbc:mysql://
      username   Username used to connect to the database
      password   Password used to connect to the database
      config - configuration of connection pool
      a new instance configured from the provided config
    • connection

      Connection connection()
      Return a connection from the pool. The call to Connection.close() should return that connection to the pool. The connection pool should handle capacity issues and timeouts using unchecked exceptions thrown by this method.
      a connection read to execute statements
    • dbType

      default String dbType()
      The type of this database. This could be "jdbc:mysql", etc. Default value is just "jdbc" but implementing class should set something more specific.
      type of this database
    • name

      default String name()
      Description copied from interface: NamedService
      Name of this implementation, as provided in ConfiguredProvider.create(Config, String).
      Specified by:
      name in interface NamedService
      name of this service
    • type

      default String type()
      Description copied from interface: NamedService
      Type of this implementation, to distinguish instances of same type, with different Use for example ConfiguredProvider.configKey() to define the type.
      Specified by:
      type in interface NamedService
      type of this service