source: trunk/src/gcc/libjava/java/sql/Array.java@ 2

Last change on this file since 2 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 8.4 KB
Line 
1/* Array.java -- Interface for accessing SQL array object
2 Copyright (C) 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38
39package java.sql;
40
41import java.util.Map;
42
43/**
44 * This interface provides methods for accessing SQL array types
45 *
46 * @author Aaron M. Renn ([email protected])
47 */
48public interface Array
49{
50
51/**
52 * This method returns the name of the SQL type of the elements in this
53 * array. This name is database specific.
54 *
55 * @param The name of the SQL type of the elements in this array.
56 *
57 * @exception SQLException If an error occurs.
58 */
59public abstract String
60getBaseTypeName() throws SQLException;
61
62/*************************************************************************/
63
64/**
65 * This method returns the JDBC type identifier of the elements in this
66 * array. This will be one of the values defined in the <code>Types</code>
67 * class.
68 *
69 * @return The JDBC type of the elements in this array.
70 *
71 * @exception SQLException If an error occurs.
72 *
73 * @see Types
74 */
75public abstract int
76getBaseType() throws SQLException;
77
78/*************************************************************************/
79
80/**
81 * This method returns the contents of this array. This object returned
82 * will be an array of Java objects of the appropriate types.
83 *
84 * @return The contents of the array as an array of Java objects.
85 *
86 * @exception SQLException If an error occurs.
87 */
88public abstract Object
89getArray() throws SQLException;
90
91/*************************************************************************/
92
93/**
94 * This method returns the contents of this array. The specified
95 * <code>Map</code> will be used to override selected mappings between
96 * SQL types and Java classes.
97 *
98 * @param map A mapping of SQL types to Java classes.
99 *
100 * @return The contents of the array as an array of Java objects.
101 *
102 * @exception SQLException If an error occurs.
103 */
104public abstract Object
105getArray(Map map) throws SQLException;
106
107/*************************************************************************/
108
109/**
110 * This method returns a portion of this array starting at index
111 * <code>offset</code> into the array and continuing for <code>length</code>
112 * elements. Fewer than the requested number of elements will be
113 * returned if the array does not contain the requested number of elements.
114 * The object returned will be an array of Java objects of
115 * the appropriate types.
116 *
117 * @param offset The offset into this array to start returning elements from.
118 * @param count The requested number of elements to return.
119 *
120 * @return The requested portion of the array.
121 *
122 * @exception SQLException If an error occurs.
123 */
124public abstract Object
125getArray(long offset, int count) throws SQLException;
126
127/*************************************************************************/
128
129/**
130 * This method returns a portion of this array starting at index
131 * <code>offset</code> into the array and continuing for <code>length</code>
132 * elements. Fewer than the requested number of elements will be
133 * returned if the array does not contain the requested number of elements.
134 * The object returned will be an array of Java objects. The specified
135 * <code>Map</code> will be used for overriding selected SQL type to
136 * Java class mappings.
137 *
138 * @param offset The offset into this array to start returning elements from.
139 * @param count The requested number of elements to return.
140 * @param map A mapping of SQL types to Java classes.
141 *
142 * @return The requested portion of the array.
143 *
144 * @exception SQLException If an error occurs.
145 */
146public abstract Object
147getArray(long index, int count, Map map) throws SQLException;
148
149/*************************************************************************/
150
151/**
152 * This method returns the elements in the array as a <code>ResultSet</code>.
153 * Each row of the result set will have two columns. The first will be
154 * the index into the array of that row's contents. The second will be
155 * the actual value of that array element.
156 *
157 * @return The elements of this array as a <code>ResultSet</code>.
158 *
159 * @exception SQLException If an error occurs.
160 *
161 * @see ResultSet
162 */
163public abstract ResultSet
164getResultSet() throws SQLException;
165
166/*************************************************************************/
167
168/**
169 * This method returns the elements in the array as a <code>ResultSet</code>.
170 * Each row of the result set will have two columns. The first will be
171 * the index into the array of that row's contents. The second will be
172 * the actual value of that array element. The specified <code>Map</code>
173 * will be used to override selected default mappings of SQL types to
174 * Java classes.
175 *
176 * @param map A mapping of SQL types to Java classes.
177 *
178 * @return The elements of this array as a <code>ResultSet</code>.
179 *
180 * @exception SQLException If an error occurs.
181 *
182 * @see ResultSet
183 */
184public abstract ResultSet
185getResultSet(Map map) throws SQLException;
186
187/*************************************************************************/
188
189/**
190 * This method returns a portion of the array as a <code>ResultSet</code>.
191 * The returned portion will start at index <code>offset</code> into the
192 * array and up to <code>length</code> elements will be returned.
193 * <p>
194 * Each row of the result set will have two columns. The first will be
195 * the index into the array of that row's contents. The second will be
196 * the actual value of that array element.
197 *
198 * @param offset The index into the array to start returning elements from.
199 * @param length The requested number of elements to return.
200 *
201 * @return The requested elements of this array as a <code>ResultSet</code>.
202 *
203 * @exception SQLException If an error occurs.
204 *
205 * @see ResultSet
206 */
207public abstract ResultSet
208getResultSet(long index, int count) throws SQLException;
209
210/*************************************************************************/
211
212/**
213 * This method returns a portion of the array as a <code>ResultSet</code>.
214 * The returned portion will start at index <code>offset</code> into the
215 * array and up to <code>length</code> elements will be returned.
216 * <p>
217 * Each row of the result set will have two columns. The first will be
218 * the index into the array of that row's contents. The second will be
219 * the actual value of that array element. The specified <code>Map</code>
220 * will be used to override selected default mappings of SQL types to
221 * Java classes.
222 *
223 * @param offset The index into the array to start returning elements from.
224 * @param length The requested number of elements to return.
225 * @param map A mapping of SQL types to Java classes.
226 *
227 * @return The requested elements of this array as a <code>ResultSet</code>.
228 *
229 * @exception SQLException If an error occurs.
230 *
231 * @see ResultSet
232 */
233public abstract ResultSet
234getResultSet(long index, int count, Map map) throws SQLException;
235
236} // interface Array
237
Note: See TracBrowser for help on using the repository browser.