Examples of CommandInterface


Examples of com.alibaba.wasp.jdbc.command.CommandInterface

  @Override
  public ResultSet executeQuery(String sql) throws SQLException {
    synchronized (session) {
      checkClosed();
      closeOldResultSet();
      CommandInterface command = conn.prepareCommand(sql, fetchSize, session);
      ResultInterface result = null;
      setExecutingStatement(command);
      try {
        result = command.executeQuery(maxRows);
        session.setSessionId(result.getSessionId());
      } finally {
        setExecutingStatement(null);
      }
      command.close();
      resultSet = new JdbcResultSet(conn, this, result, closedByResultSet);
    }
    return resultSet;
  }
View Full Code Here

Examples of com.alibaba.wasp.jdbc.command.CommandInterface

        if(autoCommit) {
          throw new SQLException("batch only support without autoCommit mode");
        }

        closeOldResultSet();
        CommandInterface command = conn.prepareCommand(batchCommands, session);
        synchronized (session) {
          setExecutingStatement(command);
          try {
            updateCount = command.executeTransaction();
          } finally {
            setExecutingStatement(null);
          }
        }
        command.close();
        batchCommands = null;
        //wasp ensures all success or all failure
        for (int i = 0; i < result.length; i++) {
          result[i] = (updateCount == size) ? 1 : 0;
        }
View Full Code Here

Examples of com.alibaba.wasp.jdbc.command.CommandInterface

  private int executeUpdateInternal(String sql) throws SQLException {
    checkClosedForWrite();
    try {
      closeOldResultSet();
      CommandInterface command = conn.prepareCommand(sql, fetchSize, session);
      synchronized (session) {
        setExecutingStatement(command);
        try {
          updateCount = command.executeUpdate();
        } finally {
          setExecutingStatement(null);
        }
      }
      command.close();
      return updateCount;
    } finally {
      afterWriting();
    }
  }
View Full Code Here

Examples of com.alibaba.wasp.jdbc.command.CommandInterface

  private boolean executeInternal(String sql) throws SQLException {
    checkClosedForWrite();
    try {
      closeOldResultSet();
      CommandInterface command = conn.prepareCommand(sql, fetchSize, session);
      boolean returnsResultSet;
      synchronized (session) {
        setExecutingStatement(command);
        try {
          if (command.isQuery()) {
            returnsResultSet = true;
            ResultInterface result = command.executeQuery(maxRows);
            resultSet = new JdbcResultSet(conn, this, result, closedByResultSet);
          } else {
            returnsResultSet = false;
            updateCount = command.executeUpdate();
          }
        } finally {
          setExecutingStatement(null);
        }
      }
      command.close();
      return returnsResultSet;
    } finally {
      afterWriting();
    }
  }
View Full Code Here

Examples of it.stefanobertini.zebra.CommandInterface

public class AztecTest {

    @Test
    public void test1() {

  CommandInterface command = new Aztec(Orientation.horizontal, new Position(50, 100), 7, 47, "123456789012");

  CommandOutputBuilder output = new CommandOutputBuilder();
  output.printLn("BARCODE AZTEC 50 100 XD 7 EC 47");
  output.printLn("123456789012");
  output.printLn("ENDAZTEC");
View Full Code Here

Examples of org.h2.command.CommandInterface

    public String getCatalog() throws SQLException {
        try {
            debugCodeCall("getCatalog");
            checkClosed();
            if (catalog == null) {
                CommandInterface cat = prepareCommand("CALL DATABASE()", Integer.MAX_VALUE);
                ResultInterface result = cat.executeQuery(0, false);
                result.next();
                catalog = result.currentRow()[0].getString();
                cat.close();
            }
            return catalog;
        } catch (Exception e) {
            throw logAndConvert(e);
        }
View Full Code Here

Examples of org.h2.command.CommandInterface

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

Examples of org.h2.command.CommandInterface

            int id = getNextId(TraceObject.SAVEPOINT);
            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

Examples of org.h2.command.CommandInterface

    }

    private void checkClusterDisableAutoCommit(String serverList) {
        if (autoCommit && transferList.size() > 1) {
            setAutoCommitSend(false);
            CommandInterface c = prepareCommand("SET CLUSTER " + serverList, Integer.MAX_VALUE);
            // this will set autoCommit to false
            c.executeUpdate();
            // so we need to switch it on
            autoCommit = true;
            cluster = true;
        }
    }
View Full Code Here

Examples of org.h2.command.CommandInterface

            throw e;
        }
    }

    private void switchOffCluster() {
        CommandInterface ci = prepareCommand("SET CLUSTER ''", Integer.MAX_VALUE);
        ci.executeUpdate();
    }
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.