Examples of checkColumnExists()


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

     */
    public boolean upgrade(Connection connection, String version) throws Exception {
        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();
View Full Code Here

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

     */
    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);
View Full Code Here

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

        try {
            conn = getDatabaseConnection(connectionUrl, username, password);
            db = DatabaseTypeFactory.getDatabaseType(conn);

            if (db.checkColumnExists(conn, "rhq_server", "version")) {

                stm = conn.createStatement();
                rs = stm.executeQuery("SELECT name, version FROM rhq_server ORDER BY name asc");

                result = new LinkedHashMap<String, String>();
View Full Code Here

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

        try {
            conn = getDatabaseConnection(connectionUrl, username, password);
            db = DatabaseTypeFactory.getDatabaseType(conn);

            if (db.checkColumnExists(conn, "rhq_storage_node", "version")) {

                stm = conn.createStatement();
                rs = stm.executeQuery("SELECT address, version FROM rhq_storage_node ORDER BY address asc");

                result = new LinkedHashMap<String, String>();
View Full Code Here

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

        validateAttributes();

        try {
            DatabaseType db_type = getDatabaseType();
            Connection conn = getConnection();
            boolean exists = db_type.checkColumnExists(conn, table, column);

            if (!exists) {
                return; // good for us, its already been deleted
            }
View Full Code Here

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

        validateAttributes();

        try {
            DatabaseType db_type = getDatabaseType();
            Connection conn = getConnection();
            boolean exists = db_type.checkColumnExists(conn, table, column);

            if (!exists) {
                throw new BuildException(MSG.getMsg(DbAntI18NResourceKeys.ERROR_UPDATING_NONEXISTING_COLUMN, column,
                    table));
            }
View Full Code Here

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

        Connection conn = getConnection();
        int jdbc_type_int = translateSqlType(columnType);

        try {
            // Check to see if the column exists.
            boolean foundColumn = db_type.checkColumnExists(conn, table, column);
            if (!foundColumn) {
                throw new BuildException(MSG.getMsg(DbAntI18NResourceKeys.UPDATE_COLUMN_DOES_NOT_EXIST, column, table));
            }

            log(MSG.getMsg(DbAntI18NResourceKeys.UPDATE_EXECUTING, columnType, jdbc_type_int, table, column, value,
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.