Class PreparedDbProvider

java.lang.Object
com.opentable.db.postgres.embedded.PreparedDbProvider

public class PreparedDbProvider extends Object
  • Method Details

    • forPreparer

      public static PreparedDbProvider forPreparer(DatabasePreparer preparer)
    • forPreparer

      public static PreparedDbProvider forPreparer(DatabasePreparer preparer, Iterable<Consumer<EmbeddedPostgres.Builder>> customizers)
    • createDatabase

      public String createDatabase() throws SQLException
      Create a new database, and return it as a JDBC connection string. NB: No two invocations will return the same database.
      Returns:
      JDBC connection string.
      Throws:
      SQLException - SQLException if any
    • createNewDatabase

      public ConnectionInfo createNewDatabase() throws SQLException
      Throws:
      SQLException
    • createDataSourceFromConnectionInfo

      public DataSource createDataSourceFromConnectionInfo(ConnectionInfo connectionInfo)
      Create a new Datasource given DBInfo. More common usage is to call createDatasource().
      Parameters:
      connectionInfo - connection information
      Returns:
      Datasource
    • createDataSource

      public DataSource createDataSource() throws SQLException
      Create a new database, and return it as a DataSource. No two invocations will return the same database.
      Returns:
      Datasource the datasource
      Throws:
      SQLException - SQLException if any
    • getConfigurationTweak

      public Map<String,String> getConfigurationTweak(String dbModuleName) throws SQLException
      Return configuration tweaks in a format appropriate for otj-jdbc DatabaseModule.
      Parameters:
      dbModuleName - Name of the module
      Returns:
      Configuration properties
      Throws:
      SQLException - SQLException if any