01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package java.sql;
19:
20: import java.util.Map;
21:
22: /**
23: * An interface which provides facilities for mapping an SQL structured type to
24: * Java. The Struct object has a value for each attribute of the SQL structured
25: * type
26: */
27: public interface Struct {
28:
29: /**
30: * Gets the SQL Type name of the SQL structured type that this Struct
31: * represents
32: *
33: * @return the fully qualified name of SQL structured type
34: * @throws SQLException
35: * if a database error occurs
36: */
37: public String getSQLTypeName() throws SQLException;
38:
39: /**
40: * Gets the values of the attributes of this SQL structured type. This
41: * method uses the type map associated with the Connection for customized
42: * type mappings. Where there is no entry in the Type Map which matches the
43: * this structured type, the JDBC driver uses the standard mapping.
44: *
45: * @return an Object array containing the attributes, in order
46: * @throws SQLException
47: * if a database error occurs
48: */
49: public Object[] getAttributes() throws SQLException;
50:
51: /**
52: * Gets the values of the attributes of this SQL structured type. This
53: * method uses the supplied type map for customized type mappings. Where
54: * there is no entry in the Type Map which matches the this structured type,
55: * the JDBC driver uses the default mapping. The Connection type map is
56: * never utilized by this method.
57: *
58: * @param theMap
59: * a Map describing how SQL Type names are mapped to classes.
60: * @return an Object array containing the attributes, in order
61: * @throws SQLException
62: * if a database error occurs
63: */
64: public Object[] getAttributes(Map<String, Class<?>> theMap)
65: throws SQLException;
66: }
|