1
/* Array.java -- Interface for accessing SQL array object
2
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
4
This file is part of GNU Classpath.
6
GNU Classpath is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GNU Classpath is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with GNU Classpath; see the file COPYING. If not, write to the
18
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21
Linking this library statically or dynamically with other modules is
22
making a combined work based on this library. Thus, the terms and
23
conditions of the GNU General Public License cover the whole
26
As a special exception, the copyright holders of this library give you
27
permission to link this library with independent modules to produce an
28
executable, regardless of the license terms of these independent
29
modules, and to copy and distribute the resulting executable under
30
terms of your choice, provided that you also meet, for each linked
31
independent module, the terms and conditions of the license of that
32
module. An independent module is a module which is not derived from
33
or based on this library. If you modify this library, you may extend
34
this exception to your version of the library, but you are not
35
obligated to do so. If you do not wish to do so, delete this
36
exception statement from your version. */
44
* This interface provides methods for accessing SQL array types
46
* @author Aaron M. Renn (arenn@urbanophile.com)
48
public interface Array
52
* This method returns the name of the SQL type of the elements in this
53
* array. This name is database specific.
55
* @param The name of the SQL type of the elements in this array.
57
* @exception SQLException If an error occurs.
59
public abstract String
60
getBaseTypeName() throws SQLException;
62
/*************************************************************************/
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>
69
* @return The JDBC type of the elements in this array.
71
* @exception SQLException If an error occurs.
76
getBaseType() throws SQLException;
78
/*************************************************************************/
81
* This method returns the contents of this array. This object returned
82
* will be an array of Java objects of the appropriate types.
84
* @return The contents of the array as an array of Java objects.
86
* @exception SQLException If an error occurs.
88
public abstract Object
89
getArray() throws SQLException;
91
/*************************************************************************/
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.
98
* @param map A mapping of SQL types to Java classes.
100
* @return The contents of the array as an array of Java objects.
102
* @exception SQLException If an error occurs.
104
public abstract Object
105
getArray(Map map) throws SQLException;
107
/*************************************************************************/
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.
117
* @param offset The offset into this array to start returning elements from.
118
* @param count The requested number of elements to return.
120
* @return The requested portion of the array.
122
* @exception SQLException If an error occurs.
124
public abstract Object
125
getArray(long offset, int count) throws SQLException;
127
/*************************************************************************/
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.
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.
142
* @return The requested portion of the array.
144
* @exception SQLException If an error occurs.
146
public abstract Object
147
getArray(long index, int count, Map map) throws SQLException;
149
/*************************************************************************/
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.
157
* @return The elements of this array as a <code>ResultSet</code>.
159
* @exception SQLException If an error occurs.
163
public abstract ResultSet
164
getResultSet() throws SQLException;
166
/*************************************************************************/
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
176
* @param map A mapping of SQL types to Java classes.
178
* @return The elements of this array as a <code>ResultSet</code>.
180
* @exception SQLException If an error occurs.
184
public abstract ResultSet
185
getResultSet(Map map) throws SQLException;
187
/*************************************************************************/
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.
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.
198
* @param offset The index into the array to start returning elements from.
199
* @param length The requested number of elements to return.
201
* @return The requested elements of this array as a <code>ResultSet</code>.
203
* @exception SQLException If an error occurs.
207
public abstract ResultSet
208
getResultSet(long index, int count) throws SQLException;
210
/*************************************************************************/
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.
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
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.
227
* @return The requested elements of this array as a <code>ResultSet</code>.
229
* @exception SQLException If an error occurs.
233
public abstract ResultSet
234
getResultSet(long index, int count, Map map) throws SQLException;