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