src/java.sql/share/classes/java/sql/Struct.java
author herrick
Wed, 20 Nov 2019 10:17:37 -0500
branchJDK-8200758-branch
changeset 59160 e90068e7afa1
parent 47216 71c04702a3d5
permissions -rw-r--r--
JDK-8234402: revert change that stopped providing JPackageToolProvider Reviewed-by: asemenyuk, almatvee, kcr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21278
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * <p>The standard mapping in the Java programming language for an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * structured type. A <code>Struct</code> object contains a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * value for each attribute of the SQL structured type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * it represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * By default, an instance of<code>Struct</code> is valid as long as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * application has a reference to it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * All methods on the <code>Struct</code> interface must be fully implemented if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * JDBC driver supports the data type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public interface Struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
   * Retrieves the SQL type name of the SQL structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
   * that this <code>Struct</code> object represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
   * @return the fully-qualified type name of the SQL structured
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
   *          type for which this <code>Struct</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
   *          is the generic representation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  String getSQLTypeName() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
   * Produces the ordered values of the attributes of the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
   * structured type that this <code>Struct</code> object represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
   * As individual attributes are processed, this method uses the type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
   * associated with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
   * connection for customizations of the type mappings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
   * If there is no
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
   * entry in the connection's type map that matches the structured
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
   * type that an attribute represents,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
   * the driver uses the standard mapping.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
   * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
   * Conceptually, this method calls the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
   * <code>getObject</code> on each attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
   * of the structured type and returns a Java array containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
   * the result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
   * @return an array containing the ordered attribute values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  Object[] getAttributes() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
   * Produces the ordered values of the attributes of the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
   * structured type that this <code>Struct</code> object represents.
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 5506
diff changeset
    84
   *  As individual attributes are processed, this method uses the given type map
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
   * for customizations of the type mappings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
   * If there is no
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
   * entry in the given type map that matches the structured
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
   * type that an attribute represents,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
   * the driver uses the standard mapping. This method never
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
   * uses the type map associated with the connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
   * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
   * Conceptually, this method calls the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
   * <code>getObject</code> on each attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
   * of the structured type and returns a Java array containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
   * the result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
   * @param map a mapping of SQL type names to Java classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
   * @return an array containing the ordered attribute values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
   * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
   * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
   * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
   */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
  Object[] getAttributes(java.util.Map<String,Class<?>> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
      throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
}