Package liquibase.database.jvm

Examples of liquibase.database.jvm.JdbcConnection


  private ResourceLoader resourceLoader;

  private Database getDatabase() {
    try {
      return DatabaseFactory.getInstance().findCorrectDatabaseImplementation(
          new JdbcConnection(dataSource.getConnection()));
    } catch (Exception e) {
      throw processException("Error getting database from " + dataSource.getUrl(), e);
    }
  }
View Full Code Here


        return null;
    }

    @Override
    public void execute(Database db) throws CustomChangeException {
        JdbcConnection conn = (JdbcConnection) db.getConnection();
        FixDuplicatePools fixer = new FixDuplicatePools(conn,
            new LiquibaseCustomTaskLogger());

        try {
            fixer.execute();
View Full Code Here

        this.changelogFile = changelogFile;

        try {
            String connectionUrl = getJdbcUrl("testing");
            Connection jdbcConnection = DriverManager.getConnection(connectionUrl, "sa", "");
            DatabaseConnection conn = new JdbcConnection(jdbcConnection);
            database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(conn);
            accessor = new ClassLoaderResourceAccessor();
        }
        catch (Exception e) {
            throw new IllegalStateException(e);
View Full Code Here

        ClassLoader classLoader = currentThread.getContextClassLoader();
        ResourceAccessor accessor = new ClassLoaderResourceAccessor(classLoader);

        DataSource dataSource = getDataSource(sessionFactory);
        connection = dataSource.getConnection();
        JdbcConnection jdbcConnection = new JdbcConnection(connection);

        Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(jdbcConnection);

        if (database instanceof PostgresDatabase) {
          database = new PostgresDatabase() {
View Full Code Here

  @PostConstruct
  protected void bootstrap() {
    ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor(getClass().getClassLoader());
    try (Connection connection = ds.getConnection()) {
      JdbcConnection jdbcConnection = new JdbcConnection(connection);
      Database db = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(jdbcConnection);

      Liquibase liquiBase = new Liquibase(CHANGELOG_FILE, resourceAccessor, db);
      liquiBase.update(STAGE);
    } catch (SQLException | LiquibaseException e) {
View Full Code Here

  }

  @Override
  public void execute(Database database) throws CustomChangeException {
    AssertUtil.assertTrue("Expected JdbcConnection to be able to extract raw JDBC connection", database.getConnection() instanceof JdbcConnection);
    JdbcConnection lbConn = (JdbcConnection) database.getConnection();
    Connection conn = lbConn.getWrappedConnection();
    DbDataUtil.executeInsert(conn, this.dataSetUrl, this.cleanInsert);
  }
View Full Code Here

   
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        try {
          JdbcConnection jdbcConn = new JdbcConnection(conn);
         
          /*
           * The default implementation of Liquibase for Oracle has an error in the default Schema
           * lookup, so we'll set it here to avoid problems.
           */
 
View Full Code Here

        if (migrationFile == null) {
            throw new IllegalArgumentException("database.migrationFile must be set in order to run database migration.");
        }
        try {
            UrsusJDBCDataSource ursusJDBCDataSource = new UrsusJDBCDataSource(ursusJDBCConfiguration);
            Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(ursusJDBCDataSource.getConnection()));
            Liquibase liquibase = new Liquibase(migrationFile, new ClassLoaderResourceAccessor(), database);

            Liquibase_Command liquibaseCommand = Liquibase_Command.valueOf(command.toLowerCase());

            if (liquibaseCommand.equals(Liquibase_Command.dropall))
View Full Code Here

    @Override
    public void runLiquibaseCommand(UrsusJDBCConfiguration.Database ursusJDBCConfiguration, String command) {
        try {
            UrsusJDBCDataSource ursusJDBCDataSource = new UrsusJDBCDataSource(ursusJDBCConfiguration);
            Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(ursusJDBCDataSource.getConnection()));
            Liquibase liquibase = new Liquibase(ursusJDBCConfiguration.getMigrationFile(), new ClassLoaderResourceAccessor(), database);

            Liquibase_Command liquibaseCommand = Liquibase_Command.valueOf(command.toLowerCase());

            if (liquibaseCommand.equals(Liquibase_Command.dropall))
View Full Code Here

        statement.executeUpdate("drop schema zanata_unit_test");
        statement.executeUpdate("create schema zanata_unit_test");
        statement.executeUpdate("use zanata_unit_test");

        Database database = DatabaseFactory.getInstance()
                .findCorrectDatabaseImplementation(new JdbcConnection(conn));

        Liquibase liquibase = new Liquibase("db/db.changelog.xml",
                new ClassLoaderResourceAccessor(), database);
        liquibase.update(null);
    }
View Full Code Here

TOP

Related Classes of liquibase.database.jvm.JdbcConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.