home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / sql / Struct.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  2.8 KB  |  84 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)Struct.java    1.12 98/09/27
  3.  * 
  4.  * Copyright 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.sql;
  16.  
  17. /**
  18.  * JDBC 2.0
  19.  *
  20.  * <p>The standard mapping for an SQL
  21.  * structured type. A <code>Struct</code> object contains a
  22.  * value for each attribute of the SQL structured type that
  23.  * it represents.
  24.  * By default, an instance of<code>Struct</code> is valid as long as the 
  25.  * application has a reference to it.
  26.  */
  27.  
  28. public interface Struct {
  29.  
  30.   /**
  31.    * Retrieves the SQL type name of the SQL structured type
  32.    * that this <code>Struct</code> object represents.
  33.    *
  34.    * @returns the fully-qualified type name of the SQL structured 
  35.    *          type for which this <code>Struct</code> object
  36.    *          is the generic representation
  37.    * @exception SQLException if a database access error occurs
  38.    */
  39.   String getSQLTypeName() throws SQLException;
  40.  
  41.   /**
  42.    * Produces the ordered values of the attributes of the SQL 
  43.    * structurec type that this <code>Struct</code> object represents.
  44.    * This method uses the type map associated with the 
  45.    * connection for customizations of the type mappings.
  46.    * If there is no
  47.    * entry in the connection's type map that matches the structured
  48.    * type that this <code>Struct</code> object represents,
  49.    * the driver uses the standard mapping.
  50.    * <p>
  51.    * Conceptually, this method calls the method
  52.    * <code>getObject</code> on each attribute
  53.    * of the structured type and returns a Java array containing 
  54.    * the result.
  55.    *
  56.    * @return an array containing the ordered attribute values
  57.    * @exception SQLException if a database access error occurs
  58.    */
  59.   Object[] getAttributes() throws SQLException;
  60.  
  61.   /**
  62.    * Produces the ordered values of the attributes of the SQL 
  63.    * structurec type that this <code>Struct</code> object represents.
  64.    * This method uses the given type map
  65.    * for customizations of the type mappings.
  66.    * If there is no
  67.    * entry in the given type map that matches the structured
  68.    * type that this <code>Struct</code> object represents,
  69.    * the driver uses the standard mapping.
  70.    * <p>
  71.    * Conceptually, this method calls the method
  72.    * <code>getObject</code> on each attribute
  73.    * of the structured type and returns a Java array containing
  74.    * the result.
  75.    *
  76.    * @param map a mapping of SQL type names to Java classes
  77.    * @return an array containing the ordered attribute values
  78.    * @exception SQLException if a database access error occurs
  79.    */
  80.   Object[] getAttributes(java.util.Map map) throws SQLException;
  81. }
  82.  
  83.  
  84.