public void afterLast() throws SQLException { for(int i=0; i<this.prepStmntArray.length; i++) { this.prepStmntArray[i].getSuperResultSet().afterLast(); } this.currentResultSet = this.prepStmntArray[this.totalNumOfResults - 1].getSuperResultSet(); this.currRSIndex = this.totalNumOfResults - 1; }
public void beforeFirst() throws SQLException { for(int i=0; i<this.totalNumOfResults; i++) { this.prepStmntArray[i].getSuperResultSet().beforeFirst(); } this.currentResultSet = this.prepStmntArray[0].getSuperResultSet(); this.currRSIndex = 0; }
public void clearWarnings() throws SQLException { for (int i=0; i<this.totalNumOfResults; i++) { this.prepStmntArray[i].getSuperResultSet().clearWarnings(); } }
private int completeSplitRow() throws DisconnectException, SqlException { int lastValidBytePositionBeforeFetch = 0; if (netResultSet_ != null && netResultSet_.scrollable_) { lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetchToCompleteRowset(); } else { // Shift partial row to the beginning of the dataBuffer shiftPartialRowToBeginning(); resetCurrentRowPosition(); lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetch(); } return lastValidBytePositionBeforeFetch; }
if (netResultSet_ != null && netSqlca[i].containsSqlcax()) { netResultSet_.setRowCountEvent( netSqlca[i].getRowCount( qrydscTypdef_)); if (!sqlState.equals(SQLState.ROW_DELETED) && !sqlState.equals(SQLState.ROW_UPDATED)) { netResultSet_.accumulateWarning( new SqlWarning(agent_.logWriter_, netSqlca[i])); !extdtaPositions_.isEmpty()) { if (allowServerFetch) { netResultSet_.flowFetch(); } else { return false;
protected void parseRowset_() throws SqlException { int row = 0; // Parse all the rows received in the rowset // The index we are passing will keep track of which row in the rowset we are parsing // so we can reuse the columnDataPosition/Length/IsNull arrays. while (netCursor_.calculateColumnOffsetsForRow_(row, true)) { rowsReceivedInCurrentRowset_++; row++; } // if rowset is not complete and an endqryrm was received, will skip the while loop // and go to the checkAndThrow method. otherwise flow an cntqry to try to complete // the rowset. // -- there is no need to complete the rowset for rowset cursors. fetching stops when // the end of data is returned or when an error occurs. all successfully fetched rows // are returned to the user. the specific error is not returned until the next fetch. while (rowsReceivedInCurrentRowset_ != fetchSize_ && !netCursor_.allRowsReceivedFromServer() && !isRowsetCursor_ && sensitivity_ != sensitivity_sensitive_dynamic__ && sensitivity_ != sensitivity_sensitive_static__) { flowFetchToCompleteRowset(); while (netCursor_.calculateColumnOffsetsForRow_(row, true)) { rowsReceivedInCurrentRowset_++; row++; } } checkAndThrowReceivedQueryTerminatingException(); }
protected void getMoreData_() throws SqlException { // reset the dataBuffer_ before getting more data if cursor is foward-only. // getMoreData() is only called in Cursor.next() when current position is // equal to lastValidBytePosition_. if (netResultSet_.resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) { resetDataBuffer(); } netResultSet_.flowFetch(); }
public void close() throws SQLException { for (int i = 0; i < this.totalNumOfResults; i++) { this.prepStmntArray[i].getSuperResultSet().close(); } this.currRSIndex = 0; this.totalNumOfResults = 0; this.prepStmntArray = null; returnConnection("close"); }
public SQLWarning getWarnings() throws SQLException { SQLWarning allwarnings = null; for (int i=0; i<this.totalNumOfResults; i++) { SQLWarning warnings = this.prepStmntArray[i].getSuperResultSet().getWarnings(); if (allwarnings != null) { SQLWarning warn = warnings.getNextWarning(); while(warn != null) { allwarnings.setNextWarning(warn); } } else { allwarnings = warnings; } } return allwarnings; }
private void checkAndThrowReceivedEndqryrm() throws SqlException { // If we are in a split row, and before sending CNTQRY, check whether an ENDQRYRM // has been received. if (!netResultSet_.openOnServer_) { SqlException sqlException = null; int sqlcode = com.pivotal.gemfirexd.internal.client.am.Utils.getSqlcodeFromSqlca(netResultSet_.queryTerminatingSqlca_); if (sqlcode < 0) { sqlException = new SqlException(agent_.logWriter_, netResultSet_.queryTerminatingSqlca_); } else { sqlException = new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_QUERY_PROCESSING_TERMINATED)); } try { netResultSet_.closeX(); // the auto commit logic is in closeX() } catch (SqlException e) { sqlException.setNextException(e); } throw sqlException; } }
if (netResultSet_ != null && netSqlca[i].containsSqlcax()) { netResultSet_.setRowCountEvent( netSqlca[i].getRowCount( qrydscTypdef_)); if (!sqlState.equals(SQLState.ROW_DELETED) && !sqlState.equals(SQLState.ROW_UPDATED)) { netResultSet_.accumulateWarning( new SqlWarning(agent_.logWriter_, netSqlca[i])); !extdtaPositions_.isEmpty()) { if (allowServerFetch) { netResultSet_.flowFetch(); } else { return false;
private int completeSplitRow() throws DisconnectException, SqlException { int lastValidBytePositionBeforeFetch = 0; if (netResultSet_ != null && netResultSet_.scrollable_) { lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetchToCompleteRowset(); } else { // Shift partial row to the beginning of the dataBuffer shiftPartialRowToBeginning(); resetCurrentRowPosition(); lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetch(); } return lastValidBytePositionBeforeFetch; }
protected void parseRowset_() throws SqlException { int row = 0; // Parse all the rows received in the rowset // The index we are passing will keep track of which row in the rowset we are parsing // so we can reuse the columnDataPosition/Length/IsNull arrays. while (netCursor_.calculateColumnOffsetsForRow_(row, true)) { rowsReceivedInCurrentRowset_++; row++; } // if rowset is not complete and an endqryrm was received, will skip the while loop // and go to the checkAndThrow method. otherwise flow an cntqry to try to complete // the rowset. // -- there is no need to complete the rowset for rowset cursors. fetching stops when // the end of data is returned or when an error occurs. all successfully fetched rows // are returned to the user. the specific error is not returned until the next fetch. while (rowsReceivedInCurrentRowset_ != fetchSize_ && !netCursor_.allRowsReceivedFromServer() && !isRowsetCursor_ && sensitivity_ != sensitivity_sensitive_dynamic__ && sensitivity_ != sensitivity_sensitive_static__) { flowFetchToCompleteRowset(); while (netCursor_.calculateColumnOffsetsForRow_(row, true)) { rowsReceivedInCurrentRowset_++; row++; } } checkAndThrowReceivedQueryTerminatingException(); }
protected void getMoreData_() throws SqlException { // reset the dataBuffer_ before getting more data if cursor is foward-only. // getMoreData() is only called in Cursor.next() when current position is // equal to lastValidBytePosition_. if (netResultSet_.resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) { resetDataBuffer(); } netResultSet_.flowFetch(); }
public void close() throws SQLException { for (int i = 0; i < this.totalNumOfResults; i++) { this.prepStmntArray[i].getSuperResultSet().close(); } this.currRSIndex = 0; this.totalNumOfResults = 0; this.prepStmntArray = null; returnConnection("close"); }
public SQLWarning getWarnings() throws SQLException { SQLWarning allwarnings = null; for (int i=0; i<this.totalNumOfResults; i++) { SQLWarning warnings = this.prepStmntArray[i].getSuperResultSet().getWarnings(); if (allwarnings != null) { SQLWarning warn = warnings.getNextWarning(); while(warn != null) { allwarnings.setNextWarning(warn); } } else { allwarnings = warnings; } } return allwarnings; }
private void checkAndThrowReceivedEndqryrm() throws SqlException { // If we are in a split row, and before sending CNTQRY, check whether an ENDQRYRM // has been received. if (!netResultSet_.openOnServer_) { SqlException sqlException = null; int sqlcode = com.pivotal.gemfirexd.internal.client.am.Utils.getSqlcodeFromSqlca(netResultSet_.queryTerminatingSqlca_); if (sqlcode < 0) { sqlException = new SqlException(agent_.logWriter_, netResultSet_.queryTerminatingSqlca_); } else { sqlException = new SqlException(agent_.logWriter_, new ClientMessageId(SQLState.NET_QUERY_PROCESSING_TERMINATED)); } try { netResultSet_.closeX(); // the auto commit logic is in closeX() } catch (SqlException e) { sqlException.setNextException(e); } throw sqlException; } }
private int completeSplitRow(int index) throws DisconnectException, SqlException { int lastValidBytePositionBeforeFetch = 0; if (netResultSet_ != null && netResultSet_.scrollable_) { lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetchToCompleteRowset(); } else { // Shift partial row to the beginning of the dataBuffer shiftPartialRowToBeginning(); adjustColumnOffsetsForColumnsPreviouslyCalculated(index); resetCurrentRowPosition(); lastValidBytePositionBeforeFetch = lastValidBytePosition_; netResultSet_.flowFetch(); } return lastValidBytePositionBeforeFetch; }
public void afterLast() throws SQLException { for(int i=0; i<this.prepStmntArray.length; i++) { this.prepStmntArray[i].getSuperResultSet().afterLast(); } this.currentResultSet = this.prepStmntArray[this.totalNumOfResults - 1].getSuperResultSet(); this.currRSIndex = this.totalNumOfResults - 1; }
public void clearWarnings() throws SQLException { for (int i=0; i<this.totalNumOfResults; i++) { this.prepStmntArray[i].getSuperResultSet().clearWarnings(); } }