Package org.lealone.command

Examples of org.lealone.command.Prepared.update()


        try {
            Prepared command = systemSession.prepare(sql);
            //System.out.println("execute id: " + id + ", sql=" + sql);
            command.setObjectId(id);
            command.setExecuteDirec(true);
            command.update();
        } catch (DbException e) {
            e = e.addSQL(sql);
            SQLException s = e.getSQLException();
            db.getTrace(Trace.DATABASE).error(s, sql);
            if (listener != null) {
View Full Code Here


    public void executeSQL(String sql) {
        try {
            fromZookeeper = true;
            Prepared p = systemSession.prepare(sql, true);
            p.setExecuteDirec(true);
            p.update();
        } finally {
            fromZookeeper = false;
        }
    }
View Full Code Here

        try {
            Prepared command = session.prepare(sql);
            if (command.isQuery()) {
                command.query(0);
            } else {
                command.update();
            }
            if (session.getAutoCommit()) {
                session.commit(false);
            }
        } catch (DbException e) {
View Full Code Here

        buff.append(indexName).append(" (COLUMN FAMILY ").append(Bytes.toString(MetaDataAdmin.DEFAULT_COLUMN_FAMILY));
        buff.append("(C char))");

        Prepared p = session.prepare(buff.toString(), true);
        p.setExecuteDirec(true);
        p.update();
    }

    public synchronized static void dropIndexTableIfExists(Session session, String indexName) {
        Prepared p = session.prepare("DROP TABLE IF EXISTS " + indexName, true);
        p.setExecuteDirec(true);
View Full Code Here

    }

    public synchronized static void dropIndexTableIfExists(Session session, String indexName) {
        Prepared p = session.prepare("DROP TABLE IF EXISTS " + indexName, true);
        p.setExecuteDirec(true);
        p.update();
    }

    private static void checkIndexColumnTypes(IndexColumn[] columns) {
        for (IndexColumn c : columns) {
            int type = c.column.getType();
View Full Code Here

            }
        }

        Prepared p = session.prepare(insert, true);
        p.getParameters().get(0).setValue(ValueString.get(Bytes.toString(getKey(row))));
        p.update();
    }

    //参数row是主表的记录,并不是索引表的记录
    @Override
    public void remove(Session session, Row row) {
View Full Code Here

            return;

        //删除操作转成insert null操作
        Prepared p = session.prepare(delete, true);
        p.getParameters().get(0).setValue(ValueString.get(Bytes.toString(getKey(row))));
        p.update();
    }

    @Override
    public Cursor find(TableFilter filter, SearchRow first, SearchRow last) {
        byte[] startRow = getKey(first);
View Full Code Here

    }

    public int update() {
        setParameters();
        Prepared prepared = procedure.getPrepared();
        return prepared.update();
    }

    public ResultInterface query(int limit) {
        setParameters();
        Prepared prepared = procedure.getPrepared();
View Full Code Here

        }
    }

    private void execute(String sql, boolean ddl) {
        Prepared command = session.prepare(sql);
        command.update();
        if (ddl) {
            session.commit(true);
        }
    }
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.