Package com.alibaba.wasp.jdbc.result

Examples of com.alibaba.wasp.jdbc.result.ResultRemote


  @Override
  public ResultInterface executeQuery(int maxRows) throws SQLException {
    checkParameters();
    synchronized (session) {
      int objectId = session.getNextId();
      ResultRemote result = null;
      prepareIfRequired();
      try {
        ResultTransfer transfer = new ResultTransfer(null, null);
        result = new ResultRemote(fClient, SessionFactory.createExecuteSession(), transfer, sql, objectId,
            fetchSize, true, readModel, false, null);
        isQuery = result.isQuery();
        if (!isQuery() && result.getRowCount() > 0) {
          throw JdbcException.get(SQLErrorCode.METHOD_ONLY_ALLOWED_FOR_QUERY,
              "sql:" + sql);
        }
      } catch (IOException e) {
        session.removeServer(e);
View Full Code Here


  @Override
  public int executeUpdate() throws SQLException {
    checkParameters();
    synchronized (session) {
      prepareIfRequired();
      ResultRemote result = null;
      String tablename = getTableName(sql);
      ResultTransfer transfer = new ResultTransfer(null, tablename);
      try {
        result = new ResultRemote(fClient, statementSession, transfer, sql, readModel);
        result.next();
        isQuery = result.isQuery();
        if (isQuery()) {
          throw JdbcException.get(SQLErrorCode.METHOD_NOT_ALLOWED_FOR_QUERY,
              "sql:" + sql);
        }
        Value[] values = result.currentRow();
        if (values == null || values.length == 0) {
          return 0;
        }
        if (values[0] instanceof ValueInt) {
          return ((ValueInt) values[0]).getInt();
View Full Code Here

  @Override
  public int executeTransaction() throws SQLException {
    checkParameters();
    synchronized (session) {
      prepareIfRequired();
      ResultRemote result = null;
      ResultTransfer transfer = new ResultTransfer(null, null);
      try {
        result = new ResultRemote(fClient, statementSession, transfer, sqls, true);
        result.next();
        isQuery = result.isQuery();
        if (isQuery()) {
          throw JdbcException.get(SQLErrorCode.METHOD_NOT_ALLOWED_FOR_QUERY,
              "sql:" + sql);
        }
        Value[] values = result.currentRow();
        if (values == null || values.length == 0) {
          return 0;
        }
        if (values[0] instanceof ValueInt) {
          return ((ValueInt) values[0]).getInt();
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.jdbc.result.ResultRemote

Copyright © 2018 www.massapicom. 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.