Package org.sf.bee.persistence.sql.command

Examples of org.sf.bee.persistence.sql.command.SQLCommandResponses


        final String dbName = this.getDbName();
        return this.createDatabase(dbName);
    }

    public SQLCommandResponses createDatabase(final String dbName) throws Exception {
        final SQLCommandResponses result = new SQLCommandResponses();
        if (!this.existsDatabase(dbName)) {
            final String command = this.createCreateDatabaseCommand(dbName);
            result.addAll(
                    this.executeServerCommand(command));
        }
        return result;
    }
View Full Code Here


        return this.dropDatabase(dbName);
    }

    public SQLCommandResponses dropDatabase(final String dbName)
            throws Exception {
        final SQLCommandResponses result = new SQLCommandResponses();
        if (this.existsDatabase(dbName)) {
            final String command = this.createDropDatabaseCommand(dbName);
            result.addAll(
                    this.executeServerCommand(command));
        }
        return result;
    }
View Full Code Here

        return result;
    }

    public SQLCommandResponses dropTables()
            throws Exception {
        final SQLCommandResponses result = new SQLCommandResponses();
        final Connection conn = this.getConnectionToDatabase();
        final String dbName = conn.getCatalog();
        if (this.existsDatabase(dbName)) {
            final String[] tables = this.getTableNames(conn);
            final String commands = this.createDropTableCommand(tables);
            result.addAll(
                    this.execute(conn,
                    commands,
                    _retries));
        }
        return result;
View Full Code Here

        return this.updateSchemas(connectionToSchema, connectionToDataBase);
    }

    public SQLCommandResponses updateSchemas(final Connection connectionToSchema,
            final Connection connectionToDataBase) throws Exception {
        final SQLCommandResponses result = new SQLCommandResponses();
       
        // tables
        final String[] tablecommands = this.compareTables(connectionToSchema,
                connectionToDataBase);
        if (null != tablecommands && tablecommands.length > 0) {
            result.addAll(
                    this.execute(connectionToDataBase,
                    tablecommands,
                    _retries));
        }
        // fields
        final String[] fieldscommands = this.compareTableColumns(connectionToSchema,
                connectionToDataBase);
        if (null != fieldscommands && fieldscommands.length > 0) {
            result.addAll(
                    this.execute(connectionToDataBase,
                    fieldscommands,
                    _retries));
        }
View Full Code Here

TOP

Related Classes of org.sf.bee.persistence.sql.command.SQLCommandResponses

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.