Package org.rhq.core.db

Examples of org.rhq.core.db.DatabaseType.addColumn()


        PreparedStatement preparedStatement = null;
        try {
            DatabaseType db = DatabaseTypeFactory.getDatabaseType(connection);
            boolean columnExists = db.checkColumnExists(connection, "RHQ_STORAGE_NODE", "VERSION");
            if (!columnExists) {
                db.addColumn(connection, "RHQ_STORAGE_NODE", "VERSION", "VARCHAR2", "255");
                preparedStatement = connection.prepareStatement("UPDATE RHQ_STORAGE_NODE SET VERSION = ?");
                preparedStatement.setString(1, "PRE-" + version);
                preparedStatement.executeUpdate();
                db.closeStatement(preparedStatement);
                // set column not null after it's been set
View Full Code Here


    public boolean upgrade(Connection connection, String version) throws Exception {
        PreparedStatement preparedStatement = null;
        try {
            DatabaseType db = DatabaseTypeFactory.getDatabaseType(connection);
            if (!db.checkColumnExists(connection, "RHQ_SERVER", "VERSION")) {
                db.addColumn(connection, "RHQ_SERVER", "VERSION", "VARCHAR2", "255");
                preparedStatement = connection.prepareStatement("UPDATE RHQ_SERVER SET VERSION = ?");
                preparedStatement.setString(1, "PRE-" + version);
                preparedStatement.executeUpdate();
                db.closeStatement(preparedStatement);
                // set column not null after it's been set
View Full Code Here

            DatabaseType db_type = getDatabaseType();
            Connection conn = getConnection();

            log(MSG.getMsg(DbAntI18NResourceKeys.ADD_COLUMN_EXECUTING, table, column, columnType, precision));

            db_type.addColumn(conn, table, column, columnType, precision);
        } catch (Exception e) {
            throw new BuildException(MSG.getMsg(DbAntI18NResourceKeys.ADD_COLUMN_ERROR, e), e);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.