< prev index next >

src/java.sql/share/classes/java/sql/ResultSetMetaData.java

Print this page




  23  * questions.
  24  */
  25 
  26 package java.sql;
  27 
  28 /**
  29  * An object that can be used to get information about the types
  30  * and properties of the columns in a <code>ResultSet</code> object.
  31  * The following code fragment creates the <code>ResultSet</code> object rs,
  32  * creates the <code>ResultSetMetaData</code> object rsmd, and uses rsmd
  33  * to find out how many columns rs has and whether the first column in rs
  34  * can be used in a <code>WHERE</code> clause.
  35  * <PRE>
  36  *
  37  *     ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
  38  *     ResultSetMetaData rsmd = rs.getMetaData();
  39  *     int numberOfColumns = rsmd.getColumnCount();
  40  *     boolean b = rsmd.isSearchable(1);
  41  *
  42  * </PRE>


  43  */
  44 
  45 public interface ResultSetMetaData extends Wrapper {
  46 
  47     /**
  48      * Returns the number of columns in this <code>ResultSet</code> object.
  49      *
  50      * @return the number of columns
  51      * @exception SQLException if a database access error occurs
  52      */
  53     int getColumnCount() throws SQLException;
  54 
  55     /**
  56      * Indicates whether the designated column is automatically numbered.
  57      *
  58      * @param column the first column is 1, the second is 2, ...
  59      * @return <code>true</code> if so; <code>false</code> otherwise
  60      * @exception SQLException if a database access error occurs
  61      */
  62     boolean isAutoIncrement(int column) throws SQLException;




  23  * questions.
  24  */
  25 
  26 package java.sql;
  27 
  28 /**
  29  * An object that can be used to get information about the types
  30  * and properties of the columns in a <code>ResultSet</code> object.
  31  * The following code fragment creates the <code>ResultSet</code> object rs,
  32  * creates the <code>ResultSetMetaData</code> object rsmd, and uses rsmd
  33  * to find out how many columns rs has and whether the first column in rs
  34  * can be used in a <code>WHERE</code> clause.
  35  * <PRE>
  36  *
  37  *     ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
  38  *     ResultSetMetaData rsmd = rs.getMetaData();
  39  *     int numberOfColumns = rsmd.getColumnCount();
  40  *     boolean b = rsmd.isSearchable(1);
  41  *
  42  * </PRE>
  43  *
  44  * @since 1.1
  45  */
  46 
  47 public interface ResultSetMetaData extends Wrapper {
  48 
  49     /**
  50      * Returns the number of columns in this <code>ResultSet</code> object.
  51      *
  52      * @return the number of columns
  53      * @exception SQLException if a database access error occurs
  54      */
  55     int getColumnCount() throws SQLException;
  56 
  57     /**
  58      * Indicates whether the designated column is automatically numbered.
  59      *
  60      * @param column the first column is 1, the second is 2, ...
  61      * @return <code>true</code> if so; <code>false</code> otherwise
  62      * @exception SQLException if a database access error occurs
  63      */
  64     boolean isAutoIncrement(int column) throws SQLException;


< prev index next >