KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibatis > sqlmap > client > extensions > ResultGetter


1 /*
2  * Copyright 2004 Clinton Begin
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package com.ibatis.sqlmap.client.extensions;
17
18 import java.math.BigDecimal JavaDoc;
19 import java.net.URL JavaDoc;
20 import java.sql.*;
21 import java.util.Calendar JavaDoc;
22 import java.util.Map JavaDoc;
23
24 /**
25  * Allows values to be retrieved from the underlying result set.
26  * TypeHandlerCallback implementations use this interface to
27  * get values that they can subsequently manipulate before
28  * having them returned. Each of these methods has a corresponding
29  * method on the ResultSet (or CallableStatement) class, the only
30  * difference being that there is no need to specify the column name
31  * or index with these methods.
32  * <p/>
33  * <b>NOTE:</b> There is no need to implement this. The implementation
34  * will be passed into the TypeHandlerCallback automatically.
35  */

36 public interface ResultGetter {
37
38   /**
39    * Gets an array from the underlying result set
40    * @return - the array
41    * @throws SQLException - if the underlying result set throws an exception
42    */

43   public Array getArray() throws SQLException;
44
45   /**
46    * Gets a BigDecimal from the underlying result set
47    * @return - the BigDecimal
48    * @throws SQLException - if the underlying result set throws an exception
49    */

50   public BigDecimal JavaDoc getBigDecimal() throws SQLException;
51
52   /**
53    * Gets a Blob from the underlying result set
54    * @return - the Blob
55    * @throws SQLException - if the underlying result set throws an exception
56    */

57   public Blob getBlob() throws SQLException;
58
59   /**
60    * Gets a boolean from the underlying result set
61    * @return - the boolean
62    * @throws SQLException - if the underlying result set throws an exception
63    */

64   public boolean getBoolean() throws SQLException;
65
66   /**
67    * Gets a byte from the underlying result set
68    * @return - the byte
69    * @throws SQLException - if the underlying result set throws an exception
70    */

71   public byte getByte() throws SQLException;
72
73   /**
74    * Gets a byte[] from the underlying result set
75    * @return - the byte[]
76    * @throws SQLException - if the underlying result set throws an exception
77    */

78   public byte[] getBytes() throws SQLException;
79
80   /**
81    * Gets a Clob from the underlying result set
82    * @return - the Clob
83    * @throws SQLException - if the underlying result set throws an exception
84    */

85   public Clob getClob() throws SQLException;
86
87   /**
88    * Gets a Date from the underlying result set
89    * @return - the Date
90    * @throws SQLException - if the underlying result set throws an exception
91    */

92   public Date getDate() throws SQLException;
93
94   /**
95    * Gets a Date from the underlying result set using a calendar
96    * @param cal - the Calendar
97    * @return - the Date
98    * @throws SQLException - if the underlying result set throws an exception
99    */

100   public Date getDate(Calendar JavaDoc cal) throws SQLException;
101
102   /**
103    * Gets a double from the underlying result set
104    * @return - the double
105    * @throws SQLException - if the underlying result set throws an exception
106    */

107   public double getDouble() throws SQLException;
108
109   /**
110    * Gets a float from the underlying result set
111    * @return - the float
112    * @throws SQLException - if the underlying result set throws an exception
113    */

114   public float getFloat() throws SQLException;
115
116   /**
117    * Gets an int from the underlying result set
118    * @return - the int
119    * @throws SQLException - if the underlying result set throws an exception
120    */

121   public int getInt() throws SQLException;
122
123   /**
124    * Gets a long from the underlying result set
125    * @return - the long
126    * @throws SQLException - if the underlying result set throws an exception
127    */

128   public long getLong() throws SQLException;
129
130   /**
131    * Gets an Object from the underlying result set
132    * @return - the Object
133    * @throws SQLException - if the underlying result set throws an exception
134    */

135   public Object JavaDoc getObject() throws SQLException;
136
137   /**
138    * Gets an Object from the underlying result set using a Map
139    * @param map - the Map
140    * @return - the Object
141    * @throws SQLException - if the underlying result set throws an exception
142    */

143   public Object JavaDoc getObject(Map JavaDoc map) throws SQLException;
144
145   /**
146    * Gets a Ref from the underlying result set
147    * @return - the Ref
148    * @throws SQLException - if the underlying result set throws an exception
149    */

150   public Ref getRef() throws SQLException;
151
152   /**
153    * Gets a short from the underlying result set
154    * @return - the short
155    * @throws SQLException - if the underlying result set throws an exception
156    */

157   public short getShort() throws SQLException;
158
159   /**
160    * Gets a String from the underlying result set
161    * @return - the String
162    * @throws SQLException - if the underlying result set throws an exception
163    */

164   public String JavaDoc getString() throws SQLException;
165
166   /**
167    * Gets a Time from the underlying result set
168    * @return - the Time
169    * @throws SQLException - if the underlying result set throws an exception
170    */

171   public Time getTime() throws SQLException;
172
173   /**
174    * Gets a Time from the underlying result set using a Calendar
175    * @param cal - the Calendar
176    * @return - the Time
177    * @throws SQLException - if the underlying result set throws an exception
178    */

179   public Time getTime(Calendar JavaDoc cal) throws SQLException;
180
181   /**
182    * Gets a Timestamp from the underlying result set
183    * @return - the Timestamp
184    * @throws SQLException - if the underlying result set throws an exception
185    */

186   public Timestamp getTimestamp() throws SQLException;
187
188   /**
189    * Gets a Timestamp from the underlying result set
190    * @param cal - the Calendar
191    * @return - the Timestamp
192    * @throws SQLException - if the underlying result set throws an exception
193    */

194   public Timestamp getTimestamp(Calendar JavaDoc cal) throws SQLException;
195
196   /**
197    * Gets a URL from the underlying result set
198    * @return - the URL
199    * @throws SQLException - if the underlying result set throws an exception
200    */

201   public URL JavaDoc getURL() throws SQLException;
202
203   /**
204    * Tells if the field was null
205    * @return - true if it was null
206    * @throws SQLException - if the underlying result set throws an exception
207    */

208   public boolean wasNull() throws SQLException;
209
210   /**
211    * Returns the underlying ResultSet...be careful!
212    * @return a ResultSet instance.
213    */

214   public ResultSet getResultSet();
215
216 }
217
Popular Tags