KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > uk > org > primrose > pool > core > PoolResultSet


1 /**
2 * Library name : Primrose - A Java Database Connection Pool.
3 * Published by Ben Keeping, http://primrose.org.uk .
4 * Copyright (C) 2004 Ben Keeping, primrose.org.uk
5 * Email: Use "Contact Us Form" on website
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */

21
22 package uk.org.primrose.pool.core;
23 import java.math.BigDecimal JavaDoc;
24 import java.util.Calendar JavaDoc;
25 import java.sql.*;
26
27 /**
28 * A wrapper for a vendor specific implementation of ResultSet.
29 * Allows for identifying unclosed statements before Connection close() calls.
30 */

31 public class PoolResultSet implements ResultSet {
32
33     ResultSet rs = null;
34     PoolSqlMonitor poolSqlMonitor = null;
35
36     public PoolResultSet(ResultSet rs, PoolSqlMonitor poolSqlMonitor) {
37         this.poolSqlMonitor = poolSqlMonitor;
38         poolSqlMonitor.setResultSet(this);
39         poolSqlMonitor.setResultSetClosed(false);
40         this.rs = rs;
41     }
42
43     public void setPoolSqlMonitor(PoolSqlMonitor poolSqlMonitor) {
44         this.poolSqlMonitor = poolSqlMonitor;
45     }
46
47     public PoolSqlMonitor getPoolSqlMonitor() {
48         return poolSqlMonitor;
49     }
50
51     public boolean next() throws SQLException {
52         return rs.next();
53     }
54
55     public void close() throws SQLException {
56         if (poolSqlMonitor.isResultSetClosed() == false) {
57             poolSqlMonitor.setResultSetClosed(true);
58             rs.close();
59         }
60     }
61
62     public boolean wasNull() throws SQLException {
63         return rs.wasNull();
64     }
65
66     public String JavaDoc getString(int columnIndex) throws SQLException {
67         return rs.getString(columnIndex);
68     }
69
70     public boolean getBoolean(int columnIndex) throws SQLException {
71         return rs.getBoolean(columnIndex);
72     }
73
74     public byte getByte(int columnIndex) throws SQLException {
75         return rs.getByte(columnIndex);
76     }
77
78     public short getShort(int columnIndex) throws SQLException {
79         return rs.getShort(columnIndex);
80     }
81
82     public int getInt(int columnIndex) throws SQLException {
83         return rs.getInt(columnIndex);
84     }
85
86     public long getLong(int columnIndex) throws SQLException {
87         return rs.getLong(columnIndex);
88     }
89
90     public float getFloat(int columnIndex) throws SQLException {
91         return rs.getFloat(columnIndex);
92     }
93
94     public double getDouble(int columnIndex) throws SQLException {
95         return rs.getDouble(columnIndex);
96     }
97
98     public BigDecimal JavaDoc getBigDecimal(int columnIndex, int scale) throws SQLException {
99         return rs.getBigDecimal(columnIndex, scale);
100     }
101
102     public byte[] getBytes(int columnIndex) throws SQLException {
103         return rs.getBytes(columnIndex);
104     }
105
106     public java.sql.Date JavaDoc getDate(int columnIndex) throws SQLException {
107         return rs.getDate(columnIndex);
108     }
109
110     public java.sql.Time JavaDoc getTime(int columnIndex) throws SQLException {
111         return rs.getTime(columnIndex);
112     }
113
114     public java.sql.Timestamp JavaDoc getTimestamp(int columnIndex) throws SQLException {
115         return rs.getTimestamp(columnIndex);
116     }
117
118     public java.io.InputStream JavaDoc getAsciiStream(int columnIndex) throws SQLException {
119         return rs.getAsciiStream(columnIndex);
120     }
121
122     public java.io.InputStream JavaDoc getUnicodeStream(int columnIndex) throws SQLException {
123         return rs.getUnicodeStream(columnIndex);
124     }
125
126     public java.io.InputStream JavaDoc getBinaryStream(int columnIndex) throws SQLException {
127         return rs.getBinaryStream(columnIndex);
128     }
129
130     public String JavaDoc getString(String JavaDoc columnName) throws SQLException {
131         return rs.getString(columnName);
132     }
133
134     public boolean getBoolean(String JavaDoc columnName) throws SQLException {
135         return rs.getBoolean(columnName);
136     }
137
138     public byte getByte(String JavaDoc columnName) throws SQLException {
139         return rs.getByte(columnName);
140     }
141
142     public short getShort(String JavaDoc columnName) throws SQLException {
143         return rs.getShort(columnName);
144     }
145
146     public int getInt(String JavaDoc columnName) throws SQLException {
147         return rs.getInt(columnName);
148     }
149
150     public long getLong(String JavaDoc columnName) throws SQLException {
151         return rs.getLong(columnName);
152     }
153
154     public float getFloat(String JavaDoc columnName) throws SQLException {
155         return rs.getFloat(columnName);
156     }
157
158     public double getDouble(String JavaDoc columnName) throws SQLException {
159         return rs.getDouble(columnName);
160     }
161
162     public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName, int scale) throws SQLException {
163         return rs.getBigDecimal(columnName);
164     }
165
166     public byte[] getBytes(String JavaDoc columnName) throws SQLException {
167         return rs.getBytes(columnName);
168     }
169
170     public java.sql.Date JavaDoc getDate(String JavaDoc columnName) throws SQLException {
171         return rs.getDate(columnName);
172     }
173
174     public java.sql.Time JavaDoc getTime(String JavaDoc columnName) throws SQLException {
175         return rs.getTime(columnName);
176     }
177
178     public java.sql.Timestamp JavaDoc getTimestamp(String JavaDoc columnName) throws SQLException {
179         return rs.getTimestamp(columnName);
180     }
181
182     public java.io.InputStream JavaDoc getAsciiStream(String JavaDoc columnName) throws SQLException {
183         return rs.getAsciiStream(columnName);
184     }
185
186     public java.io.InputStream JavaDoc getUnicodeStream(String JavaDoc columnName) throws SQLException {
187         return rs.getUnicodeStream(columnName);
188     }
189
190     public java.io.InputStream JavaDoc getBinaryStream(String JavaDoc columnName) throws SQLException {
191         return rs.getBinaryStream(columnName);
192     }
193
194     public SQLWarning getWarnings() throws SQLException {
195         return rs.getWarnings();
196     }
197
198     public void clearWarnings() throws SQLException {
199         rs.clearWarnings();
200     }
201
202     public String JavaDoc getCursorName() throws SQLException {
203         return rs.getCursorName();
204     }
205
206     public ResultSetMetaData getMetaData() throws SQLException {
207         return rs.getMetaData();
208     }
209
210     public Object JavaDoc getObject(int columnIndex) throws SQLException {
211         return rs.getObject(columnIndex);
212     }
213
214     public Object JavaDoc getObject(String JavaDoc columnName) throws SQLException {
215         return rs.getObject(columnName);
216     }
217
218     public int findColumn(String JavaDoc columnName) throws SQLException {
219         return rs.findColumn(columnName);
220     }
221
222     public java.io.Reader JavaDoc getCharacterStream(int columnIndex) throws SQLException {
223         return rs.getCharacterStream(columnIndex);
224     }
225
226     public java.io.Reader JavaDoc getCharacterStream(String JavaDoc columnName) throws SQLException {
227         return rs.getCharacterStream(columnName);
228     }
229
230     public BigDecimal JavaDoc getBigDecimal(int columnIndex) throws SQLException {
231         return rs.getBigDecimal(columnIndex);
232     }
233
234     public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName) throws SQLException {
235         return rs.getBigDecimal(columnName);
236     }
237
238     public boolean isBeforeFirst() throws SQLException {
239         return rs.isBeforeFirst();
240     }
241
242     public boolean isAfterLast() throws SQLException {
243         return rs.isAfterLast();
244     }
245
246     public boolean isFirst() throws SQLException {
247         return rs.isFirst();
248     }
249
250     public boolean isLast() throws SQLException {
251         return rs.isLast();
252     }
253
254     public void beforeFirst() throws SQLException {
255         rs.beforeFirst();
256     }
257
258     public void afterLast() throws SQLException {
259         rs.afterLast();
260     }
261
262     public boolean first() throws SQLException {
263         return rs.first();
264     }
265
266     public boolean last() throws SQLException {
267         return rs.last();
268     }
269
270     public int getRow() throws SQLException {
271         return rs.getRow();
272     }
273
274     public boolean absolute(int row) throws SQLException {
275         return rs.absolute(row);
276     }
277
278     public boolean relative(int rows) throws SQLException {
279         return rs.relative(rows);
280     }
281
282     public boolean previous() throws SQLException {
283         return rs.previous();
284     }
285
286     public void setFetchDirection(int direction) throws SQLException {
287         rs.setFetchDirection(direction);
288     }
289
290     public int getFetchDirection() throws SQLException {
291         return rs.getFetchDirection();
292     }
293
294     public void setFetchSize(int rows) throws SQLException {
295         rs.setFetchSize(rows);
296     }
297
298     public int getFetchSize() throws SQLException {
299         return rs.getFetchSize();
300     }
301
302     public int getConcurrency() throws SQLException {
303         return rs.getConcurrency();
304     }
305
306     public boolean rowUpdated() throws SQLException {
307         return rs.rowUpdated();
308     }
309
310     public int getType() throws SQLException {
311         return rs.getType();
312     }
313
314     public boolean rowInserted() throws SQLException {
315         return rs.rowInserted();
316     }
317
318     public boolean rowDeleted() throws SQLException {
319         return rs.rowDeleted();
320     }
321
322     public void updateNull(int columnIndex) throws SQLException {
323         rs.updateNull(columnIndex);
324     }
325
326     public void updateBoolean(int columnIndex, boolean x) throws SQLException {
327         rs.updateBoolean(columnIndex, x);
328     }
329
330     public void updateByte(int columnIndex, byte x) throws SQLException {
331         rs.updateByte(columnIndex, x);
332     }
333
334     public void updateShort(int columnIndex, short x) throws SQLException {
335         rs.updateShort(columnIndex, x);
336     }
337
338     public void updateInt(int columnIndex, int x) throws SQLException {
339         rs.updateInt(columnIndex, x);
340     }
341
342     public void updateLong(int columnIndex, long x) throws SQLException {
343         rs.updateLong(columnIndex, x);
344     }
345
346     public void updateFloat(int columnIndex, float x) throws SQLException {
347         rs.updateFloat(columnIndex, x);
348     }
349
350     public void updateDouble(int columnIndex, double x) throws SQLException {
351         rs.updateDouble(columnIndex, x);
352     }
353
354     public void updateBigDecimal(int columnIndex, BigDecimal JavaDoc x) throws SQLException {
355         rs.updateBigDecimal(columnIndex, x);
356     }
357
358     public void updateString(int columnIndex, String JavaDoc x) throws SQLException {
359         rs.updateString(columnIndex, x);
360     }
361
362     public void updateBytes(int columnIndex, byte x[]) throws SQLException {
363         rs.updateBytes(columnIndex, x);
364     }
365
366     public void updateDate(int columnIndex, java.sql.Date JavaDoc x) throws SQLException {
367         rs.updateDate(columnIndex, x);
368     }
369
370     public void updateTime(int columnIndex, java.sql.Time JavaDoc x) throws SQLException {
371         rs.updateTime(columnIndex, x);
372     }
373
374     public void updateTimestamp(int columnIndex, java.sql.Timestamp JavaDoc x) throws SQLException {
375         rs.updateTimestamp(columnIndex, x);
376     }
377
378     public void updateAsciiStream(int columnIndex, java.io.InputStream JavaDoc x, int length) throws SQLException {
379         rs.updateAsciiStream(columnIndex, x, length);
380     }
381
382     public void updateBinaryStream(int columnIndex, java.io.InputStream JavaDoc x, int length) throws SQLException {
383         rs.updateBinaryStream(columnIndex, x, length);
384     }
385
386     public void updateCharacterStream(int columnIndex, java.io.Reader JavaDoc x, int length) throws SQLException {
387         rs.updateCharacterStream(columnIndex, x, length);
388     }
389
390     public void updateObject(int columnIndex, Object JavaDoc x, int scale) throws SQLException {
391         rs.updateObject(columnIndex, x, scale);
392     }
393
394     public void updateObject(int columnIndex, Object JavaDoc x) throws SQLException {
395         rs.updateObject(columnIndex, x);
396     }
397
398     public void updateNull(String JavaDoc columnName) throws SQLException {
399         rs.updateNull(columnName);
400     }
401
402     public void updateBoolean(String JavaDoc columnName, boolean x) throws SQLException {
403         rs.updateBoolean(columnName, x);
404     }
405
406     public void updateByte(String JavaDoc columnName, byte x) throws SQLException {
407         rs.updateByte(columnName, x);
408     }
409
410     public void updateShort(String JavaDoc columnName, short x) throws SQLException {
411         rs.updateShort(columnName, x);
412     }
413
414     public void updateInt(String JavaDoc columnName, int x) throws SQLException {
415         rs.updateInt(columnName, x);
416     }
417
418     public void updateLong(String JavaDoc columnName, long x) throws SQLException {
419         rs.updateLong(columnName, x);
420     }
421
422     public void updateFloat(String JavaDoc columnName, float x) throws SQLException {
423         rs.updateFloat(columnName, x);
424     }
425
426     public void updateDouble(String JavaDoc columnName, double x) throws SQLException {
427         rs.updateDouble(columnName, x);
428     }
429
430     public void updateBigDecimal(String JavaDoc columnName, BigDecimal JavaDoc x) throws SQLException {
431         rs.updateBigDecimal(columnName, x);
432     }
433
434     public void updateString(String JavaDoc columnName, String JavaDoc x) throws SQLException {
435         rs.updateString(columnName, x);
436     }
437
438     public void updateBytes(String JavaDoc columnName, byte x[]) throws SQLException {
439         rs.updateBytes(columnName, x);
440     }
441
442     public void updateDate(String JavaDoc columnName, java.sql.Date JavaDoc x) throws SQLException {
443         rs.updateDate(columnName, x);
444     }
445
446     public void updateTime(String JavaDoc columnName, java.sql.Time JavaDoc x) throws SQLException {
447         rs.updateTime(columnName, x);
448     }
449
450     public void updateTimestamp(String JavaDoc columnName, java.sql.Timestamp JavaDoc x) throws SQLException {
451         rs.updateTimestamp(columnName, x);
452     }
453
454     public void updateAsciiStream(String JavaDoc columnName, java.io.InputStream JavaDoc x, int length) throws SQLException {
455         rs.updateAsciiStream(columnName, x, length);
456     }
457
458     public void updateBinaryStream(String JavaDoc columnName, java.io.InputStream JavaDoc x, int length) throws SQLException {
459         rs.updateBinaryStream(columnName, x, length);
460     }
461
462     public void updateCharacterStream(String JavaDoc columnName, java.io.Reader JavaDoc reader, int length) throws SQLException {
463         rs.updateCharacterStream(columnName, reader, length);
464     }
465
466     public void updateObject(String JavaDoc columnName, Object JavaDoc x, int scale) throws SQLException {
467         rs.updateObject(columnName, x, scale);
468     }
469
470     public void updateObject(String JavaDoc columnName, Object JavaDoc x) throws SQLException {
471         rs.updateObject(columnName, x);
472     }
473
474     public void insertRow() throws SQLException {
475         rs.insertRow();
476     }
477
478     public void updateRow() throws SQLException {
479         rs.updateRow();
480     }
481
482     public void deleteRow() throws SQLException {
483         rs.deleteRow();
484     }
485
486     public void refreshRow() throws SQLException {
487         rs.refreshRow();
488     }
489
490     public void cancelRowUpdates() throws SQLException {
491         rs.cancelRowUpdates();
492     }
493
494     public void moveToInsertRow() throws SQLException {
495         rs.moveToInsertRow();
496     }
497
498     public void moveToCurrentRow() throws SQLException {
499         rs.moveToCurrentRow();
500     }
501
502     public Statement getStatement() throws SQLException {
503         return rs.getStatement();
504     }
505
506     public Object JavaDoc getObject(int i, java.util.Map JavaDoc map) throws SQLException {
507         return rs.getObject(i, map);
508     }
509
510     public Ref getRef(int i) throws SQLException {
511         return rs.getRef(i);
512     }
513
514     public Blob getBlob(int i) throws SQLException {
515         return rs.getBlob(i);
516     }
517
518     public Clob getClob(int i) throws SQLException {
519         return rs.getClob(i);
520     }
521
522     public Array getArray(int i) throws SQLException {
523         return rs.getArray(i);
524     }
525
526     public Object JavaDoc getObject(String JavaDoc colName, java.util.Map JavaDoc map) throws SQLException {
527         return rs.getObject(colName, map);
528     }
529
530     public Ref getRef(String JavaDoc colName) throws SQLException {
531         return rs.getRef(colName);
532     }
533
534     public Blob getBlob(String JavaDoc colName) throws SQLException {
535         return rs.getBlob(colName);
536     }
537
538     public Clob getClob(String JavaDoc colName) throws SQLException {
539         return rs.getClob(colName);
540     }
541
542     public Array getArray(String JavaDoc colName) throws SQLException {
543         return rs.getArray(colName);
544     }
545
546     public java.sql.Date JavaDoc getDate(int columnIndex, Calendar JavaDoc cal) throws SQLException {
547         return rs.getDate(columnIndex, cal);
548     }
549
550     public java.sql.Date JavaDoc getDate(String JavaDoc columnName, Calendar JavaDoc cal) throws SQLException {
551         return rs.getDate(columnName, cal);
552     }
553
554     public java.sql.Time JavaDoc getTime(int columnIndex, Calendar JavaDoc cal) throws SQLException {
555         return rs.getTime(columnIndex, cal);
556     }
557
558     public java.sql.Time JavaDoc getTime(String JavaDoc columnName, Calendar JavaDoc cal) throws SQLException {
559         return rs.getTime(columnName, cal);
560     }
561
562     public java.sql.Timestamp JavaDoc getTimestamp(int columnIndex, Calendar JavaDoc cal) throws SQLException {
563         return rs.getTimestamp(columnIndex, cal);
564     }
565
566     public java.sql.Timestamp JavaDoc getTimestamp(String JavaDoc columnName, Calendar JavaDoc cal) throws SQLException {
567         return rs.getTimestamp(columnName, cal);
568     }
569
570     public java.net.URL JavaDoc getURL(int columnIndex) throws SQLException {
571         return rs.getURL(columnIndex);
572     }
573
574     public java.net.URL JavaDoc getURL(String JavaDoc columnName) throws SQLException {
575         return rs.getURL(columnName);
576     }
577
578     public void updateRef(int columnIndex, java.sql.Ref JavaDoc x) throws SQLException {
579         rs.updateRef(columnIndex, x);
580     }
581
582     public void updateRef(String JavaDoc columnName, java.sql.Ref JavaDoc x) throws SQLException {
583         rs.updateRef(columnName, x);
584     }
585
586     public void updateBlob(int columnIndex, java.sql.Blob JavaDoc x) throws SQLException {
587         rs.updateBlob(columnIndex, x);
588     }
589
590     public void updateBlob(String JavaDoc columnName, java.sql.Blob JavaDoc x) throws SQLException {
591         rs.updateBlob(columnName, x);
592     }
593
594     public void updateClob(int columnIndex, java.sql.Clob JavaDoc x) throws SQLException {
595         rs.updateClob(columnIndex, x);
596     }
597
598     public void updateClob(String JavaDoc columnName, java.sql.Clob JavaDoc x) throws SQLException {
599         rs.updateClob(columnName, x);
600     }
601
602     public void updateArray(int columnIndex, java.sql.Array JavaDoc x) throws SQLException {
603         rs.updateArray(columnIndex, x);
604     }
605
606     public void updateArray(String JavaDoc columnName, java.sql.Array JavaDoc x) throws SQLException {
607         rs.updateArray(columnName, x);
608     }
609 }
610
611
612
613
614
615
616
617
618
619
620
Popular Tags