📄 resultset.java
字号:
* * @param columnName is the SQL name of the column * @return the column value; if the value is SQL NULL, the result is 0 * @exception SQLException if a database-access error occurs. */ double getDouble(String columnName) throws SQLException; /** * Get the value of a column in the current row as a java.math.BigDecimal * object. * * @param columnName is the SQL name of the column * @param scale the number of digits to the right of the decimal * @return the column value; if the value is SQL NULL, the result is null * @exception SQLException if a database-access error occurs. * @deprecated */ BigDecimal getBigDecimal(String columnName, int scale) throws SQLException; /** * Get the value of a column in the current row as a Java byte array. * The bytes represent the raw values returned by the driver. * * @param columnName is the SQL name of the column * @return the column value; if the value is SQL NULL, the result is null * @exception SQLException if a database-access error occurs. */ byte[] getBytes(String columnName) throws SQLException; /** * Get the value of a column in the current row as a java.sql.Date object. * * @param columnName is the SQL name of the column * @return the column value; if the value is SQL NULL, the result is null * @exception SQLException if a database-access error occurs. */ java.sql.Date getDate(String columnName) throws SQLException; /** * Get the value of a column in the current row as a java.sql.Time object. * * @param columnName is the SQL name of the column * @return the column value; if the value is SQL NULL, the result is null * @exception SQLException if a database-access error occurs. */ java.sql.Time getTime(String columnName) throws SQLException; /** * Get the value of a column in the current row as a java.sql.Timestamp object. * * @param columnName is the SQL name of the column * @return the column value; if the value is SQL NULL, the result is null * @exception SQLException if a database-access error occurs. */ java.sql.Timestamp getTimestamp(String columnName) throws SQLException; /** * A column value can be retrieved as a stream of ASCII characters * and then read in chunks from the stream. This method is particularly * suitable for retrieving large LONGVARCHAR values. The JDBC driver will * do any necessary conversion from the database format into ASCII. * * <P><B>Note:</B> All the data in the returned stream must * be read prior to getting the value of any other column. The * next call to a get method implicitly closes the stream. * * @param columnName is the SQL name of the column * @return a Java input stream that delivers the database column value * as a stream of one byte ASCII characters. If the value is SQL NULL * then the result is null. * @exception SQLException if a database-access error occurs. */ java.io.InputStream getAsciiStream(String columnName) throws SQLException; /** * A column value can be retrieved as a stream of Unicode characters * and then read in chunks from the stream. This method is particularly * suitable for retrieving large LONGVARCHAR values. The JDBC driver will * do any necessary conversion from the database format into Unicode. * * <P><B>Note:</B> All the data in the returned stream must * be read prior to getting the value of any other column. The * next call to a get method implicitly closes the stream. * * @param columnName is the SQL name of the column * @return a Java input stream that delivers the database column value * as a stream of two byte Unicode characters. If the value is SQL NULL * then the result is null. * @exception SQLException if a database-access error occurs. * @deprecated */ java.io.InputStream getUnicodeStream(String columnName) throws SQLException; /** * A column value can be retrieved as a stream of uninterpreted bytes * and then read in chunks from the stream. This method is particularly * suitable for retrieving large LONGVARBINARY values. * * <P><B>Note:</B> All the data in the returned stream must * be read prior to getting the value of any other column. The * next call to a get method implicitly closes the stream. * * @param columnName is the SQL name of the column * @return a Java input stream that delivers the database column value * as a stream of uninterpreted bytes. If the value is SQL NULL * then the result is null. * @exception SQLException if a database-access error occurs. */ java.io.InputStream getBinaryStream(String columnName) throws SQLException; //===================================================================== // Advanced features: //===================================================================== /** * <p>The first warning reported by calls on this ResultSet is * returned. Subsequent ResultSet warnings will be chained to this * SQLWarning. * * <P>The warning chain is automatically cleared each time a new * row is read. * * <P><B>Note:</B> This warning chain only covers warnings caused * by ResultSet methods. Any warning caused by statement methods * (such as reading OUT parameters) will be chained on the * Statement object. * * @return the first SQLWarning or null * @exception SQLException if a database-access error occurs. */ SQLWarning getWarnings() throws SQLException; /** * After this call getWarnings returns null until a new warning is * reported for this ResultSet. * * @exception SQLException if a database-access error occurs. */ void clearWarnings() throws SQLException; /** * Get the name of the SQL cursor used by this ResultSet. * * <P>In SQL, a result table is retrieved through a cursor that is * named. The current row of a result can be updated or deleted * using a positioned update/delete statement that references the * cursor name. To insure that the cursor has the proper isolation * level to support update, the cursor's select statement should be * of the form 'select for update'. If the 'for update' clause is * omitted the positioned updates may fail. * * <P>JDBC supports this SQL feature by providing the name of the * SQL cursor used by a ResultSet. The current row of a ResultSet * is also the current row of this SQL cursor. * * <P><B>Note:</B> If positioned update is not supported a * SQLException is thrown * * @return the ResultSet's SQL cursor name * @exception SQLException if a database-access error occurs. */ String getCursorName() throws SQLException; /** * The number, types and properties of a ResultSet's columns * are provided by the getMetaData method. * * @return the description of a ResultSet's columns * @exception SQLException if a database-access error occurs. */ ResultSetMetaData getMetaData() throws SQLException; /** * <p>Get the value of a column in the current row as a Java object. * * <p>This method will return the value of the given column as a * Java object. The type of the Java object will be the default * Java object type corresponding to the column's SQL type, * following the mapping for built-in types specified in the JDBC * spec. * * <p>This method may also be used to read datatabase specific * abstract data types. * * JDBC 2.0 * * New behavior for getObject(). * The behavior of method getObject() is extended to materialize * data of SQL user-defined types. When the column @i is a structured * or distinct value, the behavior of this method is as if it were * a call to: getObject(i, this.getStatement().getConnection().getTypeMap()). * * @param columnIndex the first column is 1, the second is 2, ... * @return a java.lang.Object holding the column value. * @exception SQLException if a database-access error occurs. */ Object getObject(int columnIndex) throws SQLException; /** * <p>Get the value of a column in the current row as a Java object. * * <p>This method will return the value of the given column as a * Java object. The type of the Java object will be the default * Java object type corresponding to the column's SQL type, * following the mapping for built-in types specified in the JDBC * spec. * * <p>This method may also be used to read datatabase specific * abstract data types. * * JDBC 2.0 * * New behavior for getObject(). * The behavior of method getObject() is extended to materialize * data of SQL user-defined types. When the column @i is a structured * or distinct value, the behavior of this method is as if it were * a call to: getObject(i, this.getStatement().getConnection().getTypeMap()). * * @param columnName is the SQL name of the column * @return a java.lang.Object holding the column value. * @exception SQLException if a database-access error occurs. */ Object getObject(String columnName) throws SQLException; //---------------------------------------------------------------- /** * Map a Resultset column name to a ResultSet column index. * * @param columnName the name of the column * @return the column index * @exception SQLException if a database-access error occurs. */ int findColumn(String columnName) throws SQLException; //--------------------------JDBC 2.0----------------------------------- //--------------------------------------------------------------------- // Getter's and Setter's //--------------------------------------------------------------------- /** * JDBC 2.0 * * <p>Get the value of a column in the current row as a java.io.Reader. */ java.io.Reader getCharacterStream(int columnIndex) throws SQLException; /** * JDBC 2.0 * * <p>Get the value of a column in the current row as a java.io.Reader. */ java.io.Reader getCharacterStream(String columnName) throws SQLException; /** * JDBC 2.0 * * Get the value of a column in the current row as a java.math.BigDecimal * object. * * @param columnIndex the first column is 1, the second is 2, ... * @return the column value (full precision); if the value is SQL NULL, * the result is null * @exception SQLException if a database-access error occurs. */ BigDecimal getBigDecimal(int columnIndex) throws SQLException; /** * JDBC 2.0 * * Get the value of a column in the current row as a java.math.BigDecimal * object. * */ BigDecimal getBigDecimal(String columnName) throws SQLException; //--------------------------------------------------------------------- // Traversal/Positioning //--------------------------------------------------------------------- /** * JDBC 2.0 * * <p>Determine if the cursor is before the first row in the result * set. * * @return true if before the first row, false otherwise. Returns * false when the result set contains no rows. * @exception SQLException if a database-access error occurs. */ boolean isBeforeFirst() throws SQLException; /** * JDBC 2.0 * * <p>Determine if the cursor is after the last row in the result * set. * * @return true if after the last row, false otherwise. Returns * false when the result set contains no rows. * @exception SQLException if a database-access error occurs. */ boolean isAfterLast() throws SQLException; /** * JDBC 2.0 * * <p>Determine if the cursor is on the first row of the result set. * * @return true if on the first row, false otherwise. * @exception SQLException if a database-access error occurs. */ boolean isFirst() throws SQLException; /** * JDBC 2.0 * * <p>Determine if the cursor is on the last row of the result set. * Note: Calling isLast() may be expensive since 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 on the last row, false otherwise. * @exception SQLException if a database-access error occurs. */ boolean isLast() throws SQLException; /** * JDBC 2.0 * * <p>Moves 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 * result set type is TYPE_FORWARD_ONLY */ void beforeFirst() throws SQLException; /** * JDBC 2.0 * * <p>Moves 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 * result set type is TYPE_FORWARD_ONLY. */ void afterLast() throws SQLException; /** * JDBC 2.0 * * <p>Moves to the first row in the result set. * * @return true if on a valid row, false if no rows in the result set. * @exception SQLException if a database-access error occurs, or * result set type is TYPE_FORWARD_ONLY. */ boolean first() throws SQLException;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -