⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jdbcresultset.java

📁 Java写的含有一个jdbc驱动的小型数据库数据库引擎
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
	}

	if (nCurrent == null) {
	    return true;
	}

	return false;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Indicates whether the cursor is on the first row of the result set.
     *
     * @return true if the cursor is on the first row, false otherwise.
     */

//#ifdef JAVA2
    public boolean isFirst() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return iCurrentRow == 1;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Indicates whether the cursor is on the last row of the result set.
     * Note: Calling the method <code>isLast</code> may be expensive
     * because the JDBC driver
     * might need to fetch ahead one row in order to determine
     * whether the current row is the last row in the result set.
     *
     * @return true if the cursor is on the last row, false otherwise.
     * @exception SQLException if a database access error occurs
     */

//#ifdef JAVA2
    public boolean isLast() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the front of the result set, just before the
     * first row. Has no effect if the result set contains no rows.
     *
     * @exception SQLException if a database access error occurs or the
     * result set type is TYPE_FORWARD_ONLY
     */

//#ifdef JAVA2
    public void beforeFirst() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the end of the result set, just after the last
     * row.  Has no effect if the result set contains no rows.
     *
     * @exception SQLException if a database access error occurs or the
     * result set type is TYPE_FORWARD_ONLY
     */

//#ifdef JAVA2
    public void afterLast() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the first row in the result set.
     *
     * @return true if the cursor is on a valid row; false if
     * there are no rows in the result set
     * @exception SQLException if a database access error occurs or the
     * result set type is TYPE_FORWARD_ONLY
     */

//#ifdef JAVA2
    public boolean first() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the last row in the result set.
     *
     * @return true if the cursor is on a valid row;
     * false if there are no rows in the result set
     * @exception SQLException if a database access error occurs or the
     * result set type is TYPE_FORWARD_ONLY.
     */

//#ifdef JAVA2
    public boolean last() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Retrieves the current row number.  The first row is number 1, the
     * second number 2, and so on.
     *
     * @return the current row number; 0 if there is no current row
     */

//#ifdef JAVA2
    public int getRow() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return iCurrentRow;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the given row number in the result set.
     *
     * <p>If the row number is positive, the cursor moves to
     * the given row number with respect to the
     * beginning of the result set.  The first row is row 1, the second
     * is row 2, and so on.
     *
     * <p>If the given row number is negative, the cursor moves to
     * an absolute row position with respect to
     * the end of the result set.  For example, calling
     * <code>absolute(-1)</code> positions the
     * cursor on the last row, <code>absolute(-2)</code> indicates the
     * next-to-last row, and so on.
     *
     * <p>An attempt to position the cursor beyond the first/last row in
     * the result set leaves the cursor before/after the first/last
     * row, respectively.
     *
     * <p>Note: Calling <code>absolute(1)</code> is the same
     * as calling <code>first()</code>.
     * Calling <code>absolute(-1)</code> is the same as calling
     * <code>last()</code>.
     *
     * @return true if the cursor is on the result set; false otherwise
     * @exception SQLException if a database access error occurs or
     * row is 0, or result set type is TYPE_FORWARD_ONLY.
     */

//#ifdef JAVA2
    public boolean absolute(int row) throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor a relative number of rows, either positive or negative.
     * Attempting to move beyond the first/last row in the
     * result set positions the cursor before/after the
     * the first/last row. Calling <code>relative(0)</code> is valid, but does
     * not change the cursor position.
     *
     * <p>Note: Calling <code>relative(1)</code>
     * is different from calling <code>next()</code>
     * because is makes sense to call <code>next()</code> when there is no
     * current row,
     * for example, when the cursor is positioned before the first row
     * or after the last row of the result set.
     *
     * @return true if the cursor is on a row; false otherwise
     * @exception SQLException if a database access error occurs, there
     * is no current row, or the result set type is TYPE_FORWARD_ONLY
     */

//#ifdef JAVA2
    public boolean relative(int rows) throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	if (rows < 0) {
	    throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
	}

	while (rows-- > 0) {
	    next();
	}

	return nCurrent != null;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * <p>Moves the cursor to the previous row in the result set.
     *
     * <p>Note: <code>previous()</code> is not the same as
     * <code>relative(-1)</code> because it
     * makes sense to call</code>previous()</code> when there is no current row.
     *
     * @return true if the cursor is on a valid row; false if it is off the
     * result set
     * @exception SQLException if a database access error occurs or the
     * result set type is TYPE_FORWARD_ONLY
     */

//#ifdef JAVA2
    public boolean previous() throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Gives a hint as to the direction in which the rows in this result set
     * will be processed.  The initial value is determined by the statement
     * that produced the result set.  The fetch direction may be changed
     * at any time.
     *
     * @exception SQLException if a database access error occurs or
     * the result set type is TYPE_FORWARD_ONLY and the fetch direction is not
     * FETCH_FORWARD.
     */

//#ifdef JAVA2
    public void setFetchDirection(int direction) throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace(direction);
	}

	if (direction != ResultSet.FETCH_FORWARD) {
	    throw Trace.error(Trace.FUNCTION_NOT_SUPPORTED);
	}
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Returns the fetch direction for this result set.
     *
     * @return the current fetch direction for this result set
     */

//#ifdef JAVA2
    public int getFetchDirection() {
	return ResultSet.FETCH_FORWARD;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Gives the JDBC driver a hint as to the number of rows that should
     * be fetched from the database when more rows are needed for this result
     * set.  If the fetch size specified is zero, the JDBC driver
     * ignores the value and is free to make its own best guess as to what
     * the fetch size should be.  The default value is set by the statement
     * that created the result set.  The fetch size may be changed at any
     * time.
     *
     * @param rows the number of rows to fetch
     * @exception SQLException if a database access error occurs or the
     * condition 0 <= rows <= this.getMaxRows() is not satisfied.
     */

//#ifdef JAVA2
    public void setFetchSize(int rows) throws SQLException {
	if (Trace.TRACE) {
	    Trace.trace(rows);
	}
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Returns the fetch size for this result set.
     *
     * @return the current fetch size for this result set
     */

//#ifdef JAVA2
    public int getFetchSize() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return 1;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Returns the type of this result set.  The type is determined by
     * the statement that created the result set.
     *
     * @return TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or
     * TYPE_SCROLL_SENSITIVE
     */

//#ifdef JAVA2
    public int getType() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return TYPE_FORWARD_ONLY;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Returns the concurrency mode of this result set.  The concurrency
     * used is determined by the statement that created the result set.
     *
     * @return the concurrency type, CONCUR_READ_ONLY or CONCUR_UPDATABLE
     */

//#ifdef JAVA2
    public int getConcurrency() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return CONCUR_READ_ONLY;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Indicates whether the current row has been updated.  The value returned
     * depends on whether or not the result set can detect updates.
     *
     * @return true if the row has been visibly updated by the owner or
     * another, and updates are detected
     *
     * @see DatabaseMetaData#updatesAreDetected
     */

//#ifdef JAVA2
    public boolean rowUpdated() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return false;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Indicates whether the current row has had an insertion.  The value
     * returned
     * depends on whether or not the result set can detect visible inserts.
     *
     * @return true if a row has had an insertion and insertions are detected
     *
     * @see DatabaseMetaData#insertsAreDetected
     */

//#ifdef JAVA2
    public boolean rowInserted() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return false;
    }

//#endif JAVA2

    /**
     * JDBC 2.0
     *
     * Indicates whether a row has been deleted.  A deleted row may leave
     * a visible "hole" in a result set.  This method can be used to
     * detect holes in a result set.  The value returned depends on whether
     * or not the result set can detect deletions.
     *
     * @return true if a row was deleted and deletions are detected
     *
     * @see DatabaseMetaData#deletesAreDetected
     */

//#ifdef JAVA2
    public boolean rowDeleted() {
	if (Trace.TRACE) {
	    Trace.trace();
	}

	return false;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -