1. /*
  2. * @(#)Struct.java 1.16 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.sql;
  11. /**
  12. * <p>The standard mapping in the Java programming language for an SQL
  13. * structured type. A <code>Struct</code> object contains a
  14. * value for each attribute of the SQL structured type that
  15. * it represents.
  16. * By default, an instance of<code>Struct</code> is valid as long as the
  17. * application has a reference to it.
  18. * @since 1.2
  19. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  20. * 2.0 API</a>
  21. */
  22. public interface Struct {
  23. /**
  24. * Retrieves the SQL type name of the SQL structured type
  25. * that this <code>Struct</code> object represents.
  26. *
  27. * @returns the fully-qualified type name of the SQL structured
  28. * type for which this <code>Struct</code> object
  29. * is the generic representation
  30. * @exception SQLException if a database access error occurs
  31. */
  32. String getSQLTypeName() throws SQLException;
  33. /**
  34. * Produces the ordered values of the attributes of the SQL
  35. * structurec type that this <code>Struct</code> object represents.
  36. * This method uses the type map associated with the
  37. * connection for customizations of the type mappings.
  38. * If there is no
  39. * entry in the connection's type map that matches the structured
  40. * type that this <code>Struct</code> object represents,
  41. * the driver uses the standard mapping.
  42. * <p>
  43. * Conceptually, this method calls the method
  44. * <code>getObject</code> on each attribute
  45. * of the structured type and returns a Java array containing
  46. * the result.
  47. *
  48. * @return an array containing the ordered attribute values
  49. * @exception SQLException if a database access error occurs
  50. */
  51. Object[] getAttributes() throws SQLException;
  52. /**
  53. * Produces the ordered values of the attributes of the SQL
  54. * structurec type that this <code>Struct</code> object represents.
  55. * This method uses the given type map
  56. * for customizations of the type mappings.
  57. * If there is no
  58. * entry in the given type map that matches the structured
  59. * type that this <code>Struct</code> object represents,
  60. * the driver uses the standard mapping. This method never
  61. * uses the type map associated with the connection.
  62. * <p>
  63. * Conceptually, this method calls the method
  64. * <code>getObject</code> on each attribute
  65. * of the structured type and returns a Java array containing
  66. * the result.
  67. *
  68. * @param map a mapping of SQL type names to Java classes
  69. * @return an array containing the ordered attribute values
  70. * @exception SQLException if a database access error occurs
  71. */
  72. Object[] getAttributes(java.util.Map map) throws SQLException;
  73. }