Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/sql/Struct.java
38829 views
/*1* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.sql;2627/**28* <p>The standard mapping in the Java programming language for an SQL29* structured type. A <code>Struct</code> object contains a30* value for each attribute of the SQL structured type that31* it represents.32* By default, an instance of<code>Struct</code> is valid as long as the33* application has a reference to it.34* <p>35* All methods on the <code>Struct</code> interface must be fully implemented if the36* JDBC driver supports the data type.37* @since 1.238*/3940public interface Struct {4142/**43* Retrieves the SQL type name of the SQL structured type44* that this <code>Struct</code> object represents.45*46* @return the fully-qualified type name of the SQL structured47* type for which this <code>Struct</code> object48* is the generic representation49* @exception SQLException if a database access error occurs50* @exception SQLFeatureNotSupportedException if the JDBC driver does not support51* this method52* @since 1.253*/54String getSQLTypeName() throws SQLException;5556/**57* Produces the ordered values of the attributes of the SQL58* structured type that this <code>Struct</code> object represents.59* As individual attributes are processed, this method uses the type map60* associated with the61* connection for customizations of the type mappings.62* If there is no63* entry in the connection's type map that matches the structured64* type that an attribute represents,65* the driver uses the standard mapping.66* <p>67* Conceptually, this method calls the method68* <code>getObject</code> on each attribute69* of the structured type and returns a Java array containing70* the result.71*72* @return an array containing the ordered attribute values73* @exception SQLException if a database access error occurs74* @exception SQLFeatureNotSupportedException if the JDBC driver does not support75* this method76* @since 1.277*/78Object[] getAttributes() throws SQLException;7980/**81* Produces the ordered values of the attributes of the SQL82* structured type that this <code>Struct</code> object represents.83* As individual attributes are processed, this method uses the given type map84* for customizations of the type mappings.85* If there is no86* entry in the given type map that matches the structured87* type that an attribute represents,88* the driver uses the standard mapping. This method never89* uses the type map associated with the connection.90* <p>91* Conceptually, this method calls the method92* <code>getObject</code> on each attribute93* of the structured type and returns a Java array containing94* the result.95*96* @param map a mapping of SQL type names to Java classes97* @return an array containing the ordered attribute values98* @exception SQLException if a database access error occurs99* @exception SQLFeatureNotSupportedException if the JDBC driver does not support100* this method101* @since 1.2102*/103Object[] getAttributes(java.util.Map<String,Class<?>> map)104throws SQLException;105}106107108