home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / JDBC / JDBC_011 / JAVA / SQL / RESULTSE.JAV < prev    next >
Encoding:
Text File  |  1996-11-10  |  6.0 KB  |  212 lines

  1. /*
  2.  * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved.
  3.  *
  4.  * Permission to use, copy, modify, and distribute this software
  5.  * and its documentation for NON-COMMERCIAL purposes and without
  6.  * fee is hereby granted provided that this copyright notice
  7.  * appears in all copies. Please refer to the file "LICENSE"
  8.  * for further important copyright and licensing information.
  9.  *
  10.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  11.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  12.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  13.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  14.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  15.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  16.  * 
  17.  * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
  18.  * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
  19.  * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
  20.  * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
  21.  * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
  22.  * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
  23.  * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES").  SUN
  24.  * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
  25.  * HIGH RISK ACTIVITIES.
  26.  */
  27.  
  28. package java.sql;
  29.  
  30. /**
  31.  * A ResultSetMetaData object can be used to find out about the types 
  32.  * and properties of the columns in a ResultSet.
  33.  */
  34.  
  35. public interface ResultSetMetaData {
  36.  
  37.     /**
  38.      * What's the number of columns in the ResultSet?
  39.      *
  40.      * @return the number
  41.      */
  42.     int getColumnCount() throws SQLException;
  43.  
  44.     /**
  45.      * Is the column automatically numbered, thus read-only?
  46.      *
  47.      * @param column the first column is 1, the second is 2, ...
  48.      * @return true if so
  49.      */
  50.     boolean isAutoIncrement(int column) throws SQLException;
  51.  
  52.     /**
  53.      * Does a column's case matter?
  54.      *
  55.      * @param column the first column is 1, the second is 2, ...
  56.      * @return true if so
  57.      */
  58.     boolean isCaseSensitive(int column) throws SQLException;    
  59.  
  60.     /**
  61.      * Can the column be used in a where clause?
  62.      *
  63.      * @param column the first column is 1, the second is 2, ...
  64.      * @return true if so
  65.      */
  66.     boolean isSearchable(int column) throws SQLException;
  67.  
  68.     /**
  69.      * Is the column a cash value?
  70.      *
  71.      * @param column the first column is 1, the second is 2, ...
  72.      * @return true if so
  73.      */
  74.     boolean isCurrency(int column) throws SQLException;
  75.  
  76.     /**
  77.      * Can you put a NULL in this column?        
  78.      *
  79.      * @param column the first column is 1, the second is 2, ...
  80.      * @return columnNoNulls, columnNullable or columnNullableUnknown
  81.      */
  82.     int isNullable(int column) throws SQLException;
  83.  
  84.     /**
  85.      * Does not allow NULL values.
  86.      */
  87.     int columnNoNulls = 0;
  88.  
  89.     /**
  90.      * Allows NULL values.
  91.      */
  92.     int columnNullable = 1;
  93.  
  94.     /**
  95.      * Nullability unknown.
  96.      */
  97.     int columnNullableUnknown = 2;
  98.  
  99.     /**
  100.      * Is the column a signed number?
  101.      *
  102.      * @param column the first column is 1, the second is 2, ...
  103.      * @return true if so
  104.      */
  105.     boolean isSigned(int column) throws SQLException;
  106.  
  107.     /**
  108.      * What's the column's normal max width in chars?
  109.      *
  110.      * @param column the first column is 1, the second is 2, ...
  111.      * @return max width
  112.      */
  113.     int getColumnDisplaySize(int column) throws SQLException;
  114.  
  115.     /**
  116.      * What's the suggested column title for use in printouts and
  117.      * displays?
  118.      *
  119.      * @param column the first column is 1, the second is 2, ...
  120.      * @return true if so 
  121.      */
  122.     String getColumnLabel(int column) throws SQLException;    
  123.  
  124.     /**
  125.      * What's a column's name?
  126.      *
  127.      * @param column the first column is 1, the second is 2, ...
  128.      * @return column name
  129.      */
  130.     String getColumnName(int column) throws SQLException;
  131.  
  132.     /**
  133.      * What's a column's table's schema?
  134.      *
  135.      * @param column the first column is 1, the second is 2, ...
  136.      * @return schema name or "" if not applicable
  137.      */
  138.     String getSchemaName(int column) throws SQLException;
  139.  
  140.     /**
  141.      * What's a column's number of decimal digits?
  142.      *
  143.      * @param column the first column is 1, the second is 2, ...
  144.      * @return precision
  145.      */
  146.     int getPrecision(int column) throws SQLException;
  147.  
  148.     /**
  149.      * What's a column's number of digits to right of the decimal point?
  150.      *
  151.      * @param column the first column is 1, the second is 2, ...
  152.      * @return scale
  153.      */
  154.     int getScale(int column) throws SQLException;    
  155.  
  156.     /**
  157.      * What's a column's table name? 
  158.      *
  159.      * @return table name or "" if not applicable
  160.      */
  161.     String getTableName(int column) throws SQLException;
  162.  
  163.     /**
  164.      * What's a column's table's catalog name?
  165.      *
  166.      * @param column the first column is 1, the second is 2, ...
  167.      * @return column name or "" if not applicable.
  168.      */
  169.     String getCatalogName(int column) throws SQLException;
  170.  
  171.     /**
  172.      * What's a column's SQL type?
  173.      *
  174.      * @param column the first column is 1, the second is 2, ...
  175.      * @return SQL type
  176.      * @see Types
  177.      */
  178.     int getColumnType(int column) throws SQLException;
  179.  
  180.     /**
  181.      * What's a column's data source specific type name?
  182.      *
  183.      * @param column the first column is 1, the second is 2, ...
  184.      * @return type name
  185.      */
  186.     String getColumnTypeName(int column) throws SQLException;
  187.  
  188.     /**
  189.      * Is a column definitely not writable?
  190.      *
  191.      * @param column the first column is 1, the second is 2, ...
  192.      * @return true if so
  193.      */
  194.     boolean isReadOnly(int column) throws SQLException;
  195.  
  196.     /**
  197.      * Is it possible for a write on the column to succeed?
  198.      *
  199.      * @param column the first column is 1, the second is 2, ...
  200.      * @return true if so
  201.      */
  202.     boolean isWritable(int column) throws SQLException;
  203.  
  204.     /**
  205.      * Will a write on the column definitely succeed?    
  206.      *
  207.      * @param column the first column is 1, the second is 2, ...
  208.      * @return true if so
  209.      */
  210.     boolean isDefinitelyWritable(int column) throws SQLException;
  211. }
  212.