Package org.h2.command

Examples of org.h2.command.Command.executeUpdate()


            if (isDebugEnabled()) {
                debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint(" + quote(name) + ")");
            }
            checkClosed();
            CommandInterface set = prepareCommand("SAVEPOINT " + JdbcSavepoint.getName(name, 0), Integer.MAX_VALUE);
            set.executeUpdate();
            JdbcSavepoint savepoint = new JdbcSavepoint(this, 0, name, trace, id);
            return savepoint;
        } catch (Exception e) {
            throw logAndConvert(e);
        }
View Full Code Here


        if (sessionState != null && sessionState.size() > 0) {
            sessionStateUpdating = true;
            try {
                for (String sql : sessionState) {
                    CommandInterface ci = prepareCommand(sql, Integer.MAX_VALUE);
                    ci.executeUpdate();
                }
            } finally {
                sessionStateUpdating = false;
                sessionStateChanged = false;
            }
View Full Code Here

        for (String setting : ci.getKeys()) {
            String value = ci.getProperty(setting);
            try {
                CommandInterface command = session.prepareCommand("SET " + Parser.quoteIdentifier(setting) + " "
                        + value, Integer.MAX_VALUE);
                command.executeUpdate();
            } catch (DbException e) {
                if (!ignoreUnknownSetting) {
                    session.close();
                    throw e;
                }
View Full Code Here

            }
        }
        if (init != null) {
            try {
                CommandInterface command = session.prepareCommand(init, Integer.MAX_VALUE);
                command.executeUpdate();
            } catch (DbException e) {
                if (!ignoreUnknownSetting) {
                    session.close();
                    throw e;
                }
View Full Code Here

            // this will call setAutoCommit(false)
            switchOffAutoCommit.executeUpdate();
            // so we need to switch it on
            autoCommit = true;
            CommandInterface c = prepareCommand("SET CLUSTER " + serverList, Integer.MAX_VALUE);
            c.executeUpdate();
            cluster = true;
        }
    }

    public void setAutoCommit(boolean autoCommit) {
View Full Code Here

        }
    }

    private void switchOffCluster() {
        CommandInterface ci = prepareCommand("SET CLUSTER ''", Integer.MAX_VALUE);
        ci.executeUpdate();
    }

    /**
     * Remove a server from the list of cluster nodes and disables the cluster
     * mode.
 
View Full Code Here

    }

    public void test() throws Exception {
        String create = "CREATE TABLE CLOB_TEST(ID INT PRIMARY KEY, WORDS {0})";
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "VARCHAR(255)"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "VARCHAR fail");
        db.close();

        db = Db.open("jdbc:h2:mem:", "sa", "sa");
View Full Code Here

        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "VARCHAR fail");
        db.close();

        db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.executeUpdate(MessageFormat.format(create, "TEXT"));
        db.insertAll(StringRecord.getList());
        testSimpleUpdate(db, "CLOB fail because of single quote artifacts");
        db.close();
    }
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.