Package liquibase.database.jvm

Examples of liquibase.database.jvm.JdbcConnection


            }
            provider.start();
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            if (System.getProperty("liquibase") == null || !System.getProperty("liquibase").equals("false")) {
                // If database is locked, retry 10 times before we give up and force the lock to be released
                for(int i=0;i<10 && liquibase.listLocks().length>0;i++) {
                    Thread.sleep(1000);
                }
View Full Code Here


            DatabaseProvider provider = InjectHelper.instanceWithName(DatabaseProvider.class, database);
            try {
                Connection connection = provider.getConnection();
                Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database-drop.xml", new
                        ClassLoaderResourceAccessor(),
                        new JdbcConnection(connection));
                liquibase.update("");
                liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                        ClassLoaderResourceAccessor(),
                        new JdbcConnection(connection));
                liquibase.update("");
            } catch (LiquibaseException e) {
                e.printStackTrace();
                progressHandler.failed(getId(), e.getLocalizedMessage());
                return;
View Full Code Here

    void execute(Connection connection) throws PluginException {
        try {
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/sampledata/smd-database.sampledata.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
        } catch (LiquibaseException e) {
            e.printStackTrace();
            throw new PluginException(getClass().getSimpleName() + " failure", e);
        }
View Full Code Here

        try {
            progressHandler.progress(getId(),"Deleting database contents",1L,2L);
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database-drop.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
            progressHandler.progress(getId(), "Creating fresh database", 2L, 2L);
            liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");
            progressHandler.finished(getId());
        } catch (LiquibaseException e) {
            progressHandler.failed(getId(),e.getMessage());
        } catch (SQLException e) {
View Full Code Here

            }
            provider.start();
            Connection connection = provider.getConnection();
            Liquibase liquibase = new Liquibase("org/socialmusicdiscovery/server/database/smd-database.changelog.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            if (System.getProperty("liquibase") == null || !System.getProperty("liquibase").equals("false")) {
                liquibase.update("");
            }
            liquibase = new Liquibase("org/socialmusicdiscovery/server/database/sampledata/large/large.xml", new
                    ClassLoaderResourceAccessor(),
                    new JdbcConnection(connection));
            liquibase.update("");

            // Ensure that we don't delete the database contents
            System.setProperty("hibernate.hbm2ddl.auto", "validate");
            System.out.println("Starting to update search relations...");
View Full Code Here

   
    this.emUtil.doWork(new DsWork() {
      @Override
      public void execute(DataSource ds) {
        try (Connection conn = ds.getConnection()) {
          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

   
    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

            Connection connection = null;
            try {

                connection = dataSource.get().getConnection();
                DatabaseConnection dc = new JdbcConnection( connection );
                Liquibase liquibase = new Liquibase( config.get().changeLog().get(), new ClassLoaderResourceAccessor(), dc );
                liquibase.update( config.get().contexts().get() );

            } catch ( SQLException e ) {
View Full Code Here

    private final ManagedDataSource dataSource;

    public CloseableLiquibase(ManagedDataSource dataSource) throws LiquibaseException, SQLException {
        super(DEFAULT_MIGRATIONS_FILE,
              new ClassLoaderResourceAccessor(),
              new JdbcConnection(dataSource.getConnection()));
        this.dataSource = dataSource;
    }
View Full Code Here

    }

    public CloseableLiquibase(ManagedDataSource dataSource, String file) throws LiquibaseException, SQLException {
        super(file,
              new FileSystemResourceAccessor(),
              new JdbcConnection(dataSource.getConnection()));
        this.dataSource = dataSource;
    }
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.