1 |
/* Array.java -- Interface for accessing SQL array object |
/* Array.java -- Interface for accessing SQL array object |
2 |
Copyright (C) 1999, 2000 Free Software Foundation, Inc. |
Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
35 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
|
|
|
38 |
package java.sql; |
package java.sql; |
39 |
|
|
40 |
import java.util.Map; |
import java.util.Map; |
41 |
|
|
42 |
/** |
/** |
43 |
* This interface provides methods for accessing SQL array types |
* This interface provides methods for accessing SQL array types. |
44 |
* |
* |
45 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
46 |
*/ |
*/ |
47 |
public interface Array |
public interface Array |
48 |
{ |
{ |
49 |
|
/** |
50 |
/** |
* Returns the name of the SQL type of the elements in this |
51 |
* This method returns the name of the SQL type of the elements in this |
* array. This name is database specific. |
52 |
* array. This name is database specific. |
* |
53 |
* |
* @param The name of the SQL type of the elements in this array. |
54 |
* @param The name of the SQL type of the elements in this array. |
* @exception SQLException If an error occurs. |
55 |
* |
*/ |
56 |
* @exception SQLException If an error occurs. |
public String getBaseTypeName() throws SQLException; |
57 |
*/ |
|
58 |
public abstract String |
/** |
59 |
getBaseTypeName() throws SQLException; |
* Returns the JDBC type identifier of the elements in this |
60 |
|
* array. This will be one of the values defined in the |
61 |
/*************************************************************************/ |
* <code>Types</code> class. |
62 |
|
* |
63 |
/** |
* @return The JDBC type of the elements in this array. |
64 |
* This method returns the JDBC type identifier of the elements in this |
* @exception SQLException If an error occurs. |
65 |
* array. This will be one of the values defined in the <code>Types</code> |
* @see Types |
66 |
* class. |
*/ |
67 |
* |
public int getBaseType() throws SQLException; |
68 |
* @return The JDBC type of the elements in this array. |
|
69 |
* |
/** |
70 |
* @exception SQLException If an error occurs. |
* Returns the contents of this array. This object returned |
71 |
* |
* will be an array of Java objects of the appropriate types. |
72 |
* @see Types |
* |
73 |
*/ |
* @return The contents of the array as an array of Java objects. |
74 |
public abstract int |
* @exception SQLException If an error occurs. |
75 |
getBaseType() throws SQLException; |
*/ |
76 |
|
public Object getArray() throws SQLException; |
77 |
/*************************************************************************/ |
|
78 |
|
/** |
79 |
/** |
* Returns the contents of this array. The specified |
80 |
* This method returns the contents of this array. This object returned |
* <code>Map</code> will be used to override selected mappings |
81 |
* will be an array of Java objects of the appropriate types. |
* between SQL types and Java classes. |
82 |
* |
* |
83 |
* @return The contents of the array as an array of Java objects. |
* @param map A mapping of SQL types to Java classes. |
84 |
* |
* @return The contents of the array as an array of Java objects. |
85 |
* @exception SQLException If an error occurs. |
* @exception SQLException If an error occurs. |
86 |
*/ |
*/ |
87 |
public abstract Object |
public Object getArray(Map map) throws SQLException; |
88 |
getArray() throws SQLException; |
|
89 |
|
/** |
90 |
/*************************************************************************/ |
* Returns a portion of this array starting at <code>index</code> |
91 |
|
* into the array and continuing for <code>count</code> |
92 |
/** |
* elements. Fewer than the requested number of elements will be |
93 |
* This method returns the contents of this array. The specified |
* returned if the array does not contain the requested number of elements. |
94 |
* <code>Map</code> will be used to override selected mappings between |
* The object returned will be an array of Java objects of |
95 |
* SQL types and Java classes. |
* the appropriate types. |
96 |
* |
* |
97 |
* @param map A mapping of SQL types to Java classes. |
* @param offset The offset into this array to start returning elements from. |
98 |
* |
* @param count The requested number of elements to return. |
99 |
* @return The contents of the array as an array of Java objects. |
* @return The requested portion of the array. |
100 |
* |
* @exception SQLException If an error occurs. |
101 |
* @exception SQLException If an error occurs. |
*/ |
102 |
*/ |
public Object getArray(long index, int count) throws SQLException; |
103 |
public abstract Object |
|
104 |
getArray(Map map) throws SQLException; |
/** |
105 |
|
* This method returns a portion of this array starting at <code>index</code> |
106 |
/*************************************************************************/ |
* into the array and continuing for <code>count</code> |
107 |
|
* elements. Fewer than the requested number of elements will be |
108 |
/** |
* returned if the array does not contain the requested number of elements. |
109 |
* This method returns a portion of this array starting at index |
* The object returned will be an array of Java objects. The specified |
110 |
* <code>offset</code> into the array and continuing for <code>length</code> |
* <code>Map</code> will be used for overriding selected SQL type to |
111 |
* elements. Fewer than the requested number of elements will be |
* Java class mappings. |
112 |
* returned if the array does not contain the requested number of elements. |
* |
113 |
* The object returned will be an array of Java objects of |
* @param offset The offset into this array to start returning elements from. |
114 |
* the appropriate types. |
* @param count The requested number of elements to return. |
115 |
* |
* @param map A mapping of SQL types to Java classes. |
116 |
* @param offset The offset into this array to start returning elements from. |
* @return The requested portion of the array. |
117 |
* @param count The requested number of elements to return. |
* @exception SQLException If an error occurs. |
118 |
* |
*/ |
119 |
* @return The requested portion of the array. |
public Object getArray(long index, int count, Map map) throws SQLException; |
120 |
* |
|
121 |
* @exception SQLException If an error occurs. |
/** |
122 |
*/ |
* Returns the elements in the array as a <code>ResultSet</code>. |
123 |
public abstract Object |
* Each row of the result set will have two columns. The first will be |
124 |
getArray(long offset, int count) throws SQLException; |
* the index into the array of that row's contents. The second will be |
125 |
|
* the actual value of that array element. |
126 |
/*************************************************************************/ |
* |
127 |
|
* @return The elements of this array as a <code>ResultSet</code>. |
128 |
/** |
* @exception SQLException If an error occurs. |
129 |
* This method returns a portion of this array starting at index |
* @see ResultSet |
130 |
* <code>offset</code> into the array and continuing for <code>length</code> |
*/ |
131 |
* elements. Fewer than the requested number of elements will be |
public ResultSet getResultSet() throws SQLException; |
132 |
* returned if the array does not contain the requested number of elements. |
|
133 |
* The object returned will be an array of Java objects. The specified |
/** |
134 |
* <code>Map</code> will be used for overriding selected SQL type to |
* This method returns the elements in the array as a <code>ResultSet</code>. |
135 |
* Java class mappings. |
* Each row of the result set will have two columns. The first will be |
136 |
* |
* the index into the array of that row's contents. The second will be |
137 |
* @param offset The offset into this array to start returning elements from. |
* the actual value of that array element. The specified <code>Map</code> |
138 |
* @param count The requested number of elements to return. |
* will be used to override selected default mappings of SQL types to |
139 |
* @param map A mapping of SQL types to Java classes. |
* Java classes. |
140 |
* |
* |
141 |
* @return The requested portion of the array. |
* @param map A mapping of SQL types to Java classes. |
142 |
* |
* @return The elements of this array as a <code>ResultSet</code>. |
143 |
* @exception SQLException If an error occurs. |
* @exception SQLException If an error occurs. |
144 |
*/ |
* @see ResultSet |
145 |
public abstract Object |
*/ |
146 |
getArray(long index, int count, Map map) throws SQLException; |
public ResultSet getResultSet(Map map) throws SQLException; |
147 |
|
|
148 |
/*************************************************************************/ |
/** |
149 |
|
* This method returns a portion of the array as a <code>ResultSet</code>. |
150 |
/** |
* The returned portion will start at <code>index</code> into the |
151 |
* This method returns the elements in the array as a <code>ResultSet</code>. |
* array and up to <code>count</code> elements will be returned. |
152 |
* Each row of the result set will have two columns. The first will be |
* <p> |
153 |
* the index into the array of that row's contents. The second will be |
* Each row of the result set will have two columns. The first will be |
154 |
* the actual value of that array element. |
* the index into the array of that row's contents. The second will be |
155 |
* |
* the actual value of that array element. |
156 |
* @return The elements of this array as a <code>ResultSet</code>. |
* |
157 |
* |
* @param offset The index into the array to start returning elements from. |
158 |
* @exception SQLException If an error occurs. |
* @param length The requested number of elements to return. |
159 |
* |
* @return The requested elements of this array as a <code>ResultSet</code>. |
160 |
* @see ResultSet |
* @exception SQLException If an error occurs. |
161 |
*/ |
* @see ResultSet |
162 |
public abstract ResultSet |
*/ |
163 |
getResultSet() throws SQLException; |
public ResultSet getResultSet(long index, int count) throws SQLException; |
164 |
|
|
165 |
/*************************************************************************/ |
/** |
166 |
|
* This method returns a portion of the array as a <code>ResultSet</code>. |
167 |
/** |
* The returned portion will start at <code>index</code> into the |
168 |
* This method returns the elements in the array as a <code>ResultSet</code>. |
* array and up to <cod>count</code> elements will be returned. |
169 |
* Each row of the result set will have two columns. The first will be |
* <p> |
170 |
* the index into the array of that row's contents. The second will be |
* Each row of the result set will have two columns. The first will be |
171 |
* the actual value of that array element. The specified <code>Map</code> |
* the index into the array of that row's contents. The second will be |
172 |
* will be used to override selected default mappings of SQL types to |
* the actual value of that array element. The specified <code>Map</code> |
173 |
* Java classes. |
* will be used to override selected default mappings of SQL types to |
174 |
* |
* Java classes. |
175 |
* @param map A mapping of SQL types to Java classes. |
* |
176 |
* |
* @param offset The index into the array to start returning elements from. |
177 |
* @return The elements of this array as a <code>ResultSet</code>. |
* @param length The requested number of elements to return. |
178 |
* |
* @param map A mapping of SQL types to Java classes. |
179 |
* @exception SQLException If an error occurs. |
* @return The requested elements of this array as a <code>ResultSet</code>. |
180 |
* |
* @exception SQLException If an error occurs. |
181 |
* @see ResultSet |
* @see ResultSet |
182 |
*/ |
*/ |
183 |
public abstract ResultSet |
public ResultSet getResultSet(long index, int count, Map map) |
184 |
getResultSet(Map map) throws SQLException; |
throws SQLException; |
185 |
|
} |
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* This method returns a portion of the array as a <code>ResultSet</code>. |
|
|
* The returned portion will start at index <code>offset</code> into the |
|
|
* array and up to <code>length</code> elements will be returned. |
|
|
* <p> |
|
|
* Each row of the result set will have two columns. The first will be |
|
|
* the index into the array of that row's contents. The second will be |
|
|
* the actual value of that array element. |
|
|
* |
|
|
* @param offset The index into the array to start returning elements from. |
|
|
* @param length The requested number of elements to return. |
|
|
* |
|
|
* @return The requested elements of this array as a <code>ResultSet</code>. |
|
|
* |
|
|
* @exception SQLException If an error occurs. |
|
|
* |
|
|
* @see ResultSet |
|
|
*/ |
|
|
public abstract ResultSet |
|
|
getResultSet(long index, int count) throws SQLException; |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* This method returns a portion of the array as a <code>ResultSet</code>. |
|
|
* The returned portion will start at index <code>offset</code> into the |
|
|
* array and up to <code>length</code> elements will be returned. |
|
|
* <p> |
|
|
* Each row of the result set will have two columns. The first will be |
|
|
* the index into the array of that row's contents. The second will be |
|
|
* the actual value of that array element. The specified <code>Map</code> |
|
|
* will be used to override selected default mappings of SQL types to |
|
|
* Java classes. |
|
|
* |
|
|
* @param offset The index into the array to start returning elements from. |
|
|
* @param length The requested number of elements to return. |
|
|
* @param map A mapping of SQL types to Java classes. |
|
|
* |
|
|
* @return The requested elements of this array as a <code>ResultSet</code>. |
|
|
* |
|
|
* @exception SQLException If an error occurs. |
|
|
* |
|
|
* @see ResultSet |
|
|
*/ |
|
|
public abstract ResultSet |
|
|
getResultSet(long index, int count, Map map) throws SQLException; |
|
|
|
|
|
} // interface Array |
|
|
|
|