EmbeddedDB.getDBEngine
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.killbill.commons.embeddeddb.EmbeddedDB.getDBEngine(Showing top 12 results out of 315)

origin: org.kill-bill.billing/killbill-util

@Provides
@Singleton
// Note: we need to inject the pooled DataSource here, not the (direct) one from EmbeddedDB
protected GlobalLocker provideGlobalLocker(final DataSource dataSource, final EmbeddedDB embeddedDB) throws IOException {
  if (EmbeddedDB.DBEngine.MYSQL.equals(embeddedDB.getDBEngine())) {
    return new MySqlGlobalLocker(dataSource);
  } else if (EmbeddedDB.DBEngine.POSTGRESQL.equals(embeddedDB.getDBEngine())) {
    return new PostgreSQLGlobalLocker(dataSource);
  } else {
    return new MemoryGlobalLocker();
  }
}
origin: org.kill-bill.billing/killbill-util

@BeforeClass(groups = "slow")
public void beforeClass() throws Exception {
  final Injector g = Guice.createInjector(Stage.PRODUCTION, new TestUtilModuleWithEmbeddedDB(configSource));
  g.injectMembers(this);
  if (DBEngine.MYSQL.equals(helper.getDBEngine())) {
    Assert.assertTrue(locker instanceof MySqlGlobalLocker);
  } else if (DBEngine.POSTGRESQL.equals(helper.getDBEngine())) {
    Assert.assertTrue(locker instanceof PostgreSQLGlobalLocker);
  } else {
    Assert.assertTrue(locker instanceof MemoryGlobalLocker);
  }
  Assert.assertTrue(locker.isFree("a", "b"));
}
origin: org.kill-bill.billing/killbill-platform-test

protected void executePostStartupScripts(final String resourcesBase) throws IOException {
  try {
    final String databaseSpecificDDL = streamToString(Resources.getResource(resourcesBase + "/" + "ddl-" + instance.getDBEngine().name().toLowerCase() + ".sql").openStream());
    instance.executeScript(databaseSpecificDDL);
  } catch (final IllegalArgumentException e) {
    // No engine-specific DDL
  }
  final String ddl = streamToString(Resources.getResource(resourcesBase + "/ddl.sql").openStream());
  instance.executeScript(ddl);
}
origin: org.kill-bill.billing/killbill-platform-test

protected synchronized void executeEngineSpecificScripts() throws IOException, SQLException {
  switch (instance.getDBEngine()) {
    case POSTGRESQL:
      final int port = URI.create(instance.getJdbcConnectionString().substring(5)).getPort();
      final GenericStandaloneDB postgreSQLDBConnection = new PostgreSQLStandaloneDB(instance.getDatabaseName(), "postgres", "postgres", "jdbc:postgresql://localhost:" + port + "/postgres");
      postgreSQLDBConnection.initialize();
      postgreSQLDBConnection.start();
      try {
        // Setup permissions required by the PostgreSQL-specific DDL
        postgreSQLDBConnection.executeScript("alter role " + instance.getUsername() + " with superuser;");
      } finally {
        postgreSQLDBConnection.stop();
      }
      break;
    default:
      break;
  }
}
origin: org.kill-bill.commons/killbill-queue

embeddedDB.start();
if (embeddedDB.getDBEngine() == EmbeddedDB.DBEngine.POSTGRESQL) {
  embeddedDB.executeScript("CREATE DOMAIN datetime AS timestamp without time zone;" +
               "CREATE OR REPLACE FUNCTION last_insert_id() RETURNS BIGINT AS $$\n" +
origin: org.kill-bill.commons/killbill-embeddeddb-common

protected DataSource createHikariDataSource() throws IOException {
  switch(getDBEngine()) {
    case MYSQL:
      dataSourceClassName = "org.mariadb.jdbc.MySQLDataSource";
origin: org.kill-bill.billing/killbill-util

protected synchronized void executePostStartupScripts() throws IOException {
  final String databaseSpecificDDL = "org/killbill/billing/util/" + "ddl-" + instance.getDBEngine().name().toLowerCase() + ".sql";
  installDDLSilently(databaseSpecificDDL);
origin: org.kill-bill.billing/killbill-util

@Provides
@Singleton
// Note: we need to inject the pooled DataSource here, not the (direct) one from EmbeddedDB
protected GlobalLocker provideGlobalLocker(final DataSource dataSource, final EmbeddedDB embeddedDB) throws IOException {
  if (EmbeddedDB.DBEngine.MYSQL.equals(embeddedDB.getDBEngine())) {
    return new MySqlGlobalLocker(dataSource);
  } else if (EmbeddedDB.DBEngine.POSTGRESQL.equals(embeddedDB.getDBEngine())) {
    return new PostgreSQLGlobalLocker(dataSource);
  } else {
    return new MemoryGlobalLocker();
  }
}
origin: org.kill-bill.billing/killbill-util

@Provides
@Singleton
// Note: we need to inject the pooled DataSource here, not the (direct) one from EmbeddedDB
protected GlobalLocker provideGlobalLocker(final DataSource dataSource, final EmbeddedDB embeddedDB) throws IOException {
  if (EmbeddedDB.DBEngine.MYSQL.equals(embeddedDB.getDBEngine())) {
    return new MySqlGlobalLocker(dataSource);
  } else if (EmbeddedDB.DBEngine.POSTGRESQL.equals(embeddedDB.getDBEngine())) {
    return new PostgreSQLGlobalLocker(dataSource);
  } else {
    return new MemoryGlobalLocker();
  }
}
origin: org.kill-bill.commons/killbill-embeddeddb-common

protected DataSource createHikariDataSource() throws IOException {
  switch(getDBEngine()) {
    case MYSQL:
      dataSourceClassName = "org.mariadb.jdbc.MySQLDataSource";
origin: org.kill-bill.commons/killbill-queue

embeddedDB.start();
if (embeddedDB.getDBEngine() == EmbeddedDB.DBEngine.POSTGRESQL) {
  embeddedDB.executeScript("CREATE DOMAIN datetime AS timestamp without time zone;" +
               "CREATE OR REPLACE FUNCTION last_insert_id() RETURNS BIGINT AS $$\n" +
origin: org.kill-bill.commons/killbill-queue

embeddedDB.start();
if (embeddedDB.getDBEngine() == EmbeddedDB.DBEngine.POSTGRESQL) {
  embeddedDB.executeScript("CREATE DOMAIN datetime AS timestamp without time zone;" +
               "CREATE OR REPLACE FUNCTION last_insert_id() RETURNS BIGINT AS $$\n" +
org.killbill.commons.embeddeddbEmbeddedDBgetDBEngine

Popular methods of EmbeddedDB

  • getDataSource
  • executeScript
  • initialize
  • start
  • cleanupAllTables
  • refreshTableNames
  • stop
  • getDatabaseName
  • cleanupTable
  • execute
  • executeUpdate
  • getCmdLineConnectionString
  • executeUpdate,
  • getCmdLineConnectionString,
  • getConnection,
  • getJdbcConnectionString,
  • getPassword,
  • getUsername,
  • setDataSource

Popular classes and methods

  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Join (org.hibernate.mapping)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)