ResultSetMetaData.java :  » Net » jtopen-7.0 » java » sql » Java Open Source

Java Open Source » Net » jtopen 7.0 
jtopen 7.0 » java » sql » ResultSetMetaData.java
///////////////////////////////////////////////////////////////////////////////
//                                                                             
// JTOpen (IBM Toolbox for Java - OSS version)                                 
//                                                                             
// Filename: ResultSetMetaData.java
//                                                                             
// The source code contained herein is licensed under the IBM Public License   
// Version 1.0, which has been approved by the Open Source Initiative.         
// Copyright (C) 1997-2001 International Business Machines Corporation and     
// others. All rights reserved.                                                
//                                                                             
///////////////////////////////////////////////////////////////////////////////

package java.sql;


/**
 *  An object that can be used to get information about the types and properties of the columns in a ResultSet
 *  object. The following code fragment creates the ResultSet object rs, creates the ResultSetMetaData object
 *  rsmd, and uses rsmd to find out how many columns rs has.
 *
 *  <pre>
 *      ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");
 *      ResultSetMetaData rsmd = rs.getMetaData();
 *      int numberOfColumns = rsmd.getColumnCount();
 *   </pre>
 *
 *  <b>Note:</b>This class contains the smallest useful set of methods and data from java.sql.ResultSetMetaData
 */
public interface ResultSetMetaData
{
    /**
     *  Returns the number of columns in this ResultSet object.
     *
     *  @return the number of columns.
     *
     *  @exception SQLException  if a database access error occurs.
     **/
    int getColumnCount() throws SQLException;

    /**
     *  Retrieves the designated column's SQL type.
     *
     *  @param column the first column is 1, the second is 2, ...
     *
     *  @return SQL type from java.sql.Types.
     *
     *  @exception SQLException  if a database access error occurs.
     **/
    int getColumnType(int column) throws SQLException;
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.