resultset.java
来自「derby database source code.good for you.」· Java 代码 · 共 1,556 行 · 第 1/5 页
JAVA
1,556 行
public final byte[] getBytes(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBytes", columnName); } return getBytes(findColumnX(columnName)); } public final java.io.InputStream getBinaryStream(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBinaryStream", columnName); } return getBinaryStream(findColumnX(columnName)); } public final java.io.InputStream getAsciiStream(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getAsciiStream", columnName); } return getAsciiStream(findColumnX(columnName)); } public final java.io.InputStream getUnicodeStream(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getUnicodeStream", columnName); } return getUnicodeStream(findColumnX(columnName)); } public final java.io.Reader getCharacterStream(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getCharacterStream", columnName); } return getCharacterStream(findColumnX(columnName)); } public final java.sql.Blob getBlob(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBlob", columnName); } return getBlob(findColumnX(columnName)); } public final java.sql.Clob getClob(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getClob", columnName); } return getClob(findColumnX(columnName)); } public final java.sql.Array getArray(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getArray", columnName); } return getArray(findColumnX(columnName)); } public final java.sql.Ref getRef(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getRef", columnName); } return getRef(findColumnX(columnName)); } public final Object getObject(String columnName) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getObject", columnName); } return getObject(findColumnX(columnName)); } public final Object getObject(String columnName, java.util.Map map) throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getObject", columnName, map); } return getObject(findColumnX(columnName), map); } // ----------------Advanced features ----------------------------------------- public final java.sql.SQLWarning getWarnings() { if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getWarnings", warnings_); } return warnings_; } public final void clearWarnings() throws SqlException { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "clearWarnings"); } warnings_ = null; } } // An untraced version of clearWarnings() public final void clearWarningsX() { warnings_ = null; } public String getCursorName() throws SqlException { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getCursorName"); } checkForClosedResultSet(); if (generatedSection_ != null) { return "stored procedure generated cursor:" + generatedSection_.getServerCursorName(); } if (statement_.cursorName_ == null) {// cursor name is not in the maps yet. statement_.cursorName_ = statement_.section_.getServerCursorName(); if (statement_.section_ instanceof Section) { agent_.sectionManager_.mapCursorNameToQuerySection(statement_.cursorName_, (Section) statement_.section_); } } if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getCursorName", statement_.cursorName_); } return statement_.cursorName_; } } public java.sql.ResultSetMetaData getMetaData() throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getMetaData"); } java.sql.ResultSetMetaData resultSetMetaData = getMetaDataX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "getMetaData", resultSetMetaData); } return resultSetMetaData; } // used by DBMD ColumnMetaData getMetaDataX() throws SqlException { checkForClosedResultSet(); return resultSetMetaData_; } public final int findColumn(String columnName) throws SqlException { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "findColumn", columnName); } int column = findColumnX(columnName); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "findColumn", column); } return column; } } // An untraced version of findColumn() private final int findColumnX(String columnName) throws SqlException { checkForClosedResultSet(); return resultSetMetaData_.findColumnX(columnName); } //-------------------------- Traversal/Positioning --------------------------- public boolean isBeforeFirst() throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "isBeforeFirst"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); // Returns false if the ResultSet contains no rows. boolean isBeforeFirst = isBeforeFirstX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "isBeforeFirst", isBeforeFirst); } return isBeforeFirst; } private boolean isBeforeFirstX() throws SqlException { if (sensitivity_ == sensitivity_sensitive_dynamic__) { return isBeforeFirst_; } else //return ((resultSetContainsNoRows()) ? false : (currentRowInRowset_ == -1)); { return ((currentRowInRowset_ == -1) && !resultSetContainsNoRows()); } } public boolean isAfterLast() throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "isAfterLast"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); // Returns false if the ResultSet contains no rows. boolean isAfterLast = isAfterLastX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "isAfterLast", isAfterLast); } return isAfterLast; } private boolean isAfterLastX() throws SqlException { if (sensitivity_ == sensitivity_sensitive_dynamic__) { return isAfterLast_; } else { return (resultSetContainsNoRows() ? false : (firstRowInRowset_ == currentRowInRowset_ && currentRowInRowset_ == lastRowInRowset_ && lastRowInRowset_ == 0 && absolutePosition_ == rowCount_ + 1)); } } public boolean isFirst() throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "isFirst"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); // Not necessary to get the rowCount_ since currentRowInRowset_ is initialized to -1, // and it will not be changed if there is no rows in the ResultSet. boolean isFirst = isFirstX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "isFirst", isFirst); } return isFirst; } private boolean isFirstX() { if (sensitivity_ == sensitivity_sensitive_dynamic__) { return isFirst_; } return (firstRowInRowset_ == 1 && currentRowInRowset_ == 0); } public boolean isLast() throws SqlException { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "isLast"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); // Returns false if the ResultSet contains no rows. boolean isLast = isLastX(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceExit(this, "isLast", isLast); } return isLast; } private boolean isLastX() throws SqlException { if (sensitivity_ == sensitivity_sensitive_dynamic__) { return isLast_; } else { return (resultSetContainsNoRows() ? false : (firstRowInRowset_ + currentRowInRowset_) == rowCount_); } } public void beforeFirst() throws SqlException { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "beforeFirst"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); clearWarningsX(); beforeFirstX(); } } private void beforeFirstX() throws SqlException { resetRowsetFlags(); // this method has no effect if the result set has no rows. // only send cntqry to position the cursor before first if // resultset contains rows and it is not already before first, or // if the cursor is a dynamic cursor. if (sensitivity_ == sensitivity_sensitive_dynamic__ || (!resultSetContainsNoRows() && !isServersCursorPositionBeforeFirst())) { moveToBeforeFirst(); } isBeforeFirst_ = true; setRowsetBeforeFirstEvent(); cursor_.resetDataBuffer(); resetRowsetSqlca(); isValidCursorPosition_ = false; } public void afterLast() throws SqlException { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "afterLast"); } checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); clearWarningsX(); afterLastX(); } } private void afterLastX() throws SqlException { resetRowsetFlags(); // this method has no effect if the result set has no rows. // only send cntqry to position the cursor after last if // resultset contains rows and it is not already after last, or // if the cursor is a dynamic cursor. if (sensitivity_ == sensitivity_sensitive_dynamic__ || (!resultSetContains
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?