/**
   * This method will send an close command, which does not return any rowsets, to the ODBC server.
   *
   * @retrun A CloseReply class representing the reply from the ODBC server is returned
   * @exception A SQLException is thrown
   */
  CloseReply Close() throws SQLException {

    try {
      getInputOutput().setTimeout(m_ic.t4props_.getNetworkTimeout());

      LogicalByteArray wbuffer =
          CloseMessage.marshal(m_dialogueId, m_stmtLabel, SQL_CLOSE, this.m_ic);

      LogicalByteArray rbuffer = getReadBuffer(TRANSPORT.SRVR_API_SQLFREESTMT, wbuffer);

      CloseReply cr = new CloseReply(rbuffer, m_ncsAddress.getIPorName(), m_ic);

      return cr;
    } // end try
    catch (SQLException se) {
      throw se;
    } catch (CharacterCodingException e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_,
              m_locale,
              "translation_of_parameter_failed",
              "CloseMessage",
              e.getMessage());
      se.initCause(e);
      throw se;
    } catch (UnsupportedCharsetException e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_, m_locale, "unsupported_encoding", e.getCharsetName());
      se.initCause(e);
      throw se;
    } catch (Exception e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_, m_locale, "close_message_error", e.getMessage());

      se.initCause(e);
      throw se;
    } // end catch
  } // end Close
  /**
   * This method will send a fetch rowset command to the server.
   *
   * @param maxRowCnt the maximum rowset count to return
   * @param maxRowLen the maximum row length to return
   * @param sqlAsyncEnable a flag to enable/disable asynchronies execution
   * @param queryTimeout the number of seconds before the query times out
   * @retrun a FetchPerfReply class representing the reply from the ODBC server is returned
   * @exception A SQLException is thrown
   */
  FetchReply Fetch(
      int sqlAsyncEnable,
      int queryTimeout,
      int stmtHandle,
      int stmtCharset,
      int maxRowCnt,
      String cursorName,
      int cursorCharset,
      String stmtOptions)
      throws SQLException {

    try {
      getInputOutput().setTimeout(m_ic.t4props_.getNetworkTimeout());

      LogicalByteArray wbuffer =
          FetchMessage.marshal(
              m_dialogueId,
              sqlAsyncEnable,
              queryTimeout,
              stmtHandle,
              m_stmtLabel,
              stmtCharset,
              maxRowCnt,
              0 // infinite row size
              ,
              cursorName,
              cursorCharset,
              stmtOptions,
              this.m_ic);

      LogicalByteArray rbuffer = getReadBuffer(TRANSPORT.SRVR_API_SQLFETCH, wbuffer);

      //
      // Process output parameters
      //
      FetchReply frr = new FetchReply(rbuffer, m_ic);

      return frr;
    } // end try
    catch (SQLException se) {
      throw se;
    } catch (CharacterCodingException e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_,
              m_locale,
              "translation_of_parameter_failed",
              "FetchMessage",
              e.getMessage());
      se.initCause(e);
      throw se;
    } catch (UnsupportedCharsetException e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_, m_locale, "unsupported_encoding", e.getCharsetName());
      se.initCause(e);
      throw se;
    } catch (Exception e) {
      SQLException se =
          HPT4Messages.createSQLException(
              m_ic.t4props_, m_locale, "fetch_perf_message_error", e.getMessage());

      se.initCause(e);
      throw se;
    } // end catch
  } // end FetchPerf