KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > commons > dsi > HarmoniseResultSet


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.commons.dsi;
20
21 import java.io.*;
22 import java.math.BigDecimal JavaDoc;
23 import java.net.URL JavaDoc;
24 import java.sql.*;
25 import java.util.*;
26
27 /**
28  *
29  * An implementation of the <code>ResultSet</code> interface which wraps up
30  * a result set and its associated <code>Statement</code> such that
31  * the <code>Statement</code> is closed as well as the <code>ResultSet</code>
32  * when the <code>close()</code> method is called on this <code>ResultSet</code>.
33  *
34  * @author Michael Bell
35  * @version $Revision: 1.2 $
36  *
37  */

38 public class HarmoniseResultSet implements ResultSet {
39     
40     /**
41      * The statement associated to the result set.
42      */

43     Statement m_stmt = null;
44     
45     /**
46      * The result set to wrap.
47      */

48     ResultSet m_rs = null;
49     
50     /**
51      * Map of column names to values for the current row. This caching
52      * of values allows a more flexible access to the data than some
53      * <code>ResultSet</code> implementations offer.
54      *
55      */

56     Map m_rowcache = new Hashtable();
57
58     /**
59      * Constructs a result set from the given result set and associated
60      * statement.
61      *
62      * @param stmt the statement
63      * @param rs the result set
64      */

65     HarmoniseResultSet(Statement stmt, ResultSet rs) {
66         m_stmt = stmt;
67         m_rs = rs;
68     }
69
70
71     /* (non-Javadoc)
72      * @see java.sql.ResultSet#getString(java.lang.String)
73      */

74     public String JavaDoc getString(String JavaDoc str) throws SQLException {
75         String JavaDoc sResult = null;
76         
77         String JavaDoc sKey = this.getCacheKey(str);
78         
79         if(m_rowcache.size() > 0) {
80             sResult = (String JavaDoc) m_rowcache.get(sKey);
81         }
82         
83         if(sResult == null) {
84             sResult = m_rs.getString(str);
85             if(sResult != null) {
86                 m_rowcache.put(sKey, sResult);
87             }
88         }
89         
90         return sResult;
91     }
92
93     /* (non-Javadoc)
94      * @see java.sql.ResultSet#getString(int)
95      */

96     public String JavaDoc getString(int n) throws SQLException {
97         String JavaDoc sResult = null;
98         
99         String JavaDoc sKey = this.getCacheKey(n);
100         
101         if(m_rowcache.size() > 0) {
102             sResult = (String JavaDoc) m_rowcache.get(sKey);
103         }
104         
105         if(sResult == null) {
106             sResult = m_rs.getString(n);
107             if(sResult != null) {
108                 m_rowcache.put(sKey, sResult);
109             }
110         }
111         
112         return sResult;
113     }
114
115
116     /* (non-Javadoc)
117      * @see java.sql.ResultSet#next()
118      */

119     public boolean next() throws SQLException {
120         m_rowcache.clear();
121         return (m_rs.next());
122     }
123
124     /* (non-Javadoc)
125      * @see java.sql.ResultSet#close()
126      */

127     public void close() throws SQLException {
128         m_rs.close();
129         m_stmt.close();
130     }
131
132   
133   /**
134    * Returns cache key to be used for caching row data.
135    *
136    * @param n the int value
137    * @return a cache key for this <code>int</code> value
138    */

139   private String JavaDoc getCacheKey(int n) {
140     return String.valueOf(n);
141   }
142   
143   /**
144    * Returns cache key to be used for caching row data.
145    *
146    * @param sColumn the name of the column containing the value to be cached
147    * @return the cahce key for the column
148    * @throws SQLException if there is an error accessing data from the underlying result set
149    */

150   private String JavaDoc getCacheKey(String JavaDoc sColumn) throws SQLException {
151     String JavaDoc sKey = null;
152     
153     int nCols = m_rs.getMetaData().getColumnCount();
154     
155     boolean bFound = false;
156     int i=1;
157     
158     while(i <= nCols && bFound == false) {
159         if(sColumn.equalsIgnoreCase(m_rs.getMetaData().getColumnName(i)) == true) {
160             bFound = true;
161             sKey = String.valueOf(i);
162         }
163         i++;
164     }
165     
166     return sKey;
167   }
168   
169
170     /* (non-Javadoc)
171      * @see java.sql.ResultSet#absolute(int)
172      */

173     public boolean absolute(int arg0) throws SQLException {
174         return m_rs.absolute(arg0);
175     }
176
177     /* (non-Javadoc)
178      * @see java.sql.ResultSet#afterLast()
179      */

180     public void afterLast() throws SQLException {
181         m_rs.afterLast();
182     }
183
184     /* (non-Javadoc)
185      * @see java.sql.ResultSet#beforeFirst()
186      */

187     public void beforeFirst() throws SQLException {
188         m_rs.beforeFirst();
189     }
190
191
192     /* (non-Javadoc)
193      * @see java.sql.ResultSet#cancelRowUpdates()
194      */

195     public void cancelRowUpdates() throws SQLException {
196         m_rs.cancelRowUpdates();
197     }
198
199
200     /* (non-Javadoc)
201      * @see java.sql.ResultSet#deleteRow()
202      */

203     public void deleteRow() throws SQLException {
204         m_rs.deleteRow();
205     }
206
207     /* (non-Javadoc)
208      * @see java.lang.Object#equals(java.lang.Object)
209      */

210     public boolean equals(Object JavaDoc arg0) {
211         return m_rs.equals(arg0);
212     }
213
214
215     /* (non-Javadoc)
216      * @see java.sql.ResultSet#first()
217      */

218     public boolean first() throws SQLException {
219         return m_rs.first();
220     }
221
222
223     /* (non-Javadoc)
224      * @see java.sql.ResultSet#getArray(int)
225      */

226     public Array getArray(int arg0) throws SQLException {
227         return m_rs.getArray(arg0);
228     }
229
230
231     /* (non-Javadoc)
232      * @see java.sql.ResultSet#getArray(java.lang.String)
233      */

234     public Array getArray(String JavaDoc arg0) throws SQLException {
235         return m_rs.getArray(arg0);
236     }
237
238
239     /* (non-Javadoc)
240      * @see java.sql.ResultSet#getBigDecimal(int)
241      */

242     public BigDecimal JavaDoc getBigDecimal(int arg0) throws SQLException {
243         return m_rs.getBigDecimal(arg0);
244     }
245
246
247     /* (non-Javadoc)
248      * @see java.sql.ResultSet#getBigDecimal(java.lang.String)
249      */

250     public BigDecimal JavaDoc getBigDecimal(String JavaDoc arg0) throws SQLException {
251         return m_rs.getBigDecimal(arg0);
252     }
253
254
255     /* (non-Javadoc)
256      * @see java.sql.ResultSet#getBlob(int)
257      */

258     public Blob getBlob(int arg0) throws SQLException {
259         return m_rs.getBlob(arg0);
260     }
261
262
263     /* (non-Javadoc)
264      * @see java.sql.ResultSet#getBlob(java.lang.String)
265      */

266     public Blob getBlob(String JavaDoc arg0) throws SQLException {
267         return m_rs.getBlob(arg0);
268     }
269
270
271     /* (non-Javadoc)
272      * @see java.sql.ResultSet#getCharacterStream(int)
273      */

274     public Reader getCharacterStream(int arg0) throws SQLException {
275         return m_rs.getCharacterStream(arg0);
276     }
277
278
279     /* (non-Javadoc)
280      * @see java.sql.ResultSet#getCharacterStream(java.lang.String)
281      */

282     public Reader getCharacterStream(String JavaDoc arg0) throws SQLException {
283         return m_rs.getCharacterStream(arg0);
284     }
285
286
287     /* (non-Javadoc)
288      * @see java.sql.ResultSet#getClob(int)
289      */

290     public Clob getClob(int arg0) throws SQLException {
291         return m_rs.getClob(arg0);
292     }
293
294
295     /* (non-Javadoc)
296      * @see java.sql.ResultSet#getClob(java.lang.String)
297      */

298     public Clob getClob(String JavaDoc arg0) throws SQLException {
299         return m_rs.getClob(arg0);
300     }
301
302
303     /* (non-Javadoc)
304      * @see java.sql.ResultSet#getConcurrency()
305      */

306     public int getConcurrency() throws SQLException {
307         return m_rs.getConcurrency();
308     }
309
310
311     /* (non-Javadoc)
312      * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
313      */

314     public java.sql.Date JavaDoc getDate(int arg0, Calendar arg1) throws SQLException {
315         return m_rs.getDate(arg0, arg1);
316     }
317
318     /* (non-Javadoc)
319      * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)
320      */

321     public java.sql.Date JavaDoc getDate(String JavaDoc arg0, Calendar arg1) throws SQLException {
322         return m_rs.getDate(arg0, arg1);
323     }
324
325
326     /* (non-Javadoc)
327      * @see java.sql.ResultSet#getFetchDirection()
328      */

329     public int getFetchDirection() throws SQLException {
330         return m_rs.getFetchDirection();
331     }
332
333
334     /* (non-Javadoc)
335      * @see java.sql.ResultSet#getFetchSize()
336      */

337     public int getFetchSize() throws SQLException {
338         return m_rs.getFetchSize();
339     }
340
341
342     /* (non-Javadoc)
343      * @see java.sql.ResultSet#getObject(int, java.util.Map)
344      */

345     public Object JavaDoc getObject(int arg0, Map arg1) throws SQLException {
346         return m_rs.getObject(arg0, arg1);
347     }
348
349
350     /* (non-Javadoc)
351      * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map)
352      */

353     public Object JavaDoc getObject(String JavaDoc arg0, Map arg1) throws SQLException {
354         return m_rs.getObject(arg0, arg1);
355     }
356
357
358     /* (non-Javadoc)
359      * @see java.sql.ResultSet#getRef(int)
360      */

361     public Ref getRef(int arg0) throws SQLException {
362         return m_rs.getRef(arg0);
363     }
364
365
366     /* (non-Javadoc)
367      * @see java.sql.ResultSet#getRef(java.lang.String)
368      */

369     public Ref getRef(String JavaDoc arg0) throws SQLException {
370         return m_rs.getRef(arg0);
371     }
372
373
374     /* (non-Javadoc)
375      * @see java.sql.ResultSet#getRow()
376      */

377     public int getRow() throws SQLException {
378         return m_rs.getRow();
379     }
380
381
382     /* (non-Javadoc)
383      * @see java.sql.ResultSet#getStatement()
384      */

385     public Statement getStatement() throws SQLException {
386         return m_rs.getStatement();
387     }
388
389
390     /* (non-Javadoc)
391      * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
392      */

393     public Time getTime(int arg0, Calendar arg1) throws SQLException {
394         return m_rs.getTime(arg0, arg1);
395     }
396
397
398     /* (non-Javadoc)
399      * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)
400      */

401     public Time getTime(String JavaDoc arg0, Calendar arg1) throws SQLException {
402         return m_rs.getTime(arg0, arg1);
403     }
404
405
406     /* (non-Javadoc)
407      * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
408      */

409     public Timestamp getTimestamp(int arg0, Calendar arg1)
410         throws SQLException {
411         return m_rs.getTimestamp(arg0, arg1);
412     }
413
414
415     /* (non-Javadoc)
416      * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)
417      */

418     public Timestamp getTimestamp(String JavaDoc arg0, Calendar arg1)
419         throws SQLException {
420         return m_rs.getTimestamp(arg0, arg1);
421     }
422
423
424     /* (non-Javadoc)
425      * @see java.sql.ResultSet#getType()
426      */

427     public int getType() throws SQLException {
428         return m_rs.getType();
429     }
430
431
432     /* (non-Javadoc)
433      * @see java.sql.ResultSet#getURL(int)
434      */

435     public URL JavaDoc getURL(int arg0) throws SQLException {
436         return m_rs.getURL(arg0);
437     }
438
439
440     /* (non-Javadoc)
441      * @see java.sql.ResultSet#getURL(java.lang.String)
442      */

443     public URL JavaDoc getURL(String JavaDoc arg0) throws SQLException {
444         return m_rs.getURL(arg0);
445     }
446
447     /* (non-Javadoc)
448      * @see java.lang.Object#hashCode()
449      */

450     public int hashCode() {
451         return m_rs.hashCode();
452     }
453
454
455     /* (non-Javadoc)
456      * @see java.sql.ResultSet#insertRow()
457      */

458     public void insertRow() throws SQLException {
459         m_rs.insertRow();
460     }
461
462
463     /* (non-Javadoc)
464      * @see java.sql.ResultSet#isAfterLast()
465      */

466     public boolean isAfterLast() throws SQLException {
467         return m_rs.isAfterLast();
468     }
469
470
471     /* (non-Javadoc)
472      * @see java.sql.ResultSet#isBeforeFirst()
473      */

474     public boolean isBeforeFirst() throws SQLException {
475         return m_rs.isBeforeFirst();
476     }
477
478
479     /* (non-Javadoc)
480      * @see java.sql.ResultSet#isFirst()
481      */

482     public boolean isFirst() throws SQLException {
483         return m_rs.isFirst();
484     }
485
486
487     /* (non-Javadoc)
488      * @see java.sql.ResultSet#isLast()
489      */

490     public boolean isLast() throws SQLException {
491         return m_rs.isLast();
492     }
493
494
495     /* (non-Javadoc)
496      * @see java.sql.ResultSet#last()
497      */

498     public boolean last() throws SQLException {
499         return m_rs.last();
500     }
501
502     /* (non-Javadoc)
503      * @see java.sql.ResultSet#moveToCurrentRow()
504      */

505     public void moveToCurrentRow() throws SQLException {
506         m_rs.moveToCurrentRow();
507     }
508
509
510     /* (non-Javadoc)
511      * @see java.sql.ResultSet#moveToInsertRow()
512      */

513     public void moveToInsertRow() throws SQLException {
514         m_rs.moveToInsertRow();
515     }
516
517
518     /* (non-Javadoc)
519      * @see java.sql.ResultSet#previous()
520      */

521     public boolean previous() throws SQLException {
522         return m_rs.previous();
523     }
524
525
526     /* (non-Javadoc)
527      * @see java.sql.ResultSet#refreshRow()
528      */

529     public void refreshRow() throws SQLException {
530         m_rs.refreshRow();
531     }
532
533
534     /* (non-Javadoc)
535      * @see java.sql.ResultSet#relative(int)
536      */

537     public boolean relative(int arg0) throws SQLException {
538         return m_rs.relative(arg0);
539     }
540
541
542     /* (non-Javadoc)
543      * @see java.sql.ResultSet#rowDeleted()
544      */

545     public boolean rowDeleted() throws SQLException {
546         return m_rs.rowDeleted();
547     }
548
549
550     /* (non-Javadoc)
551      * @see java.sql.ResultSet#rowInserted()
552      */

553     public boolean rowInserted() throws SQLException {
554         return m_rs.rowInserted();
555     }
556
557
558     /* (non-Javadoc)
559      * @see java.sql.ResultSet#rowUpdated()
560      */

561     public boolean rowUpdated() throws SQLException {
562         return m_rs.rowUpdated();
563     }
564
565
566     /* (non-Javadoc)
567      * @see java.sql.ResultSet#setFetchDirection(int)
568      */

569     public void setFetchDirection(int arg0) throws SQLException {
570         m_rs.setFetchDirection(arg0);
571     }
572
573
574     /* (non-Javadoc)
575      * @see java.sql.ResultSet#setFetchSize(int)
576      */

577     public void setFetchSize(int arg0) throws SQLException {
578         m_rs.setFetchSize(arg0);
579     }
580
581     /* (non-Javadoc)
582      * @see java.lang.Object#toString()
583      */

584     public String JavaDoc toString() {
585         return m_rs.toString();
586     }
587
588
589     /* (non-Javadoc)
590      * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
591      */

592     public void updateArray(int arg0, Array arg1) throws SQLException {
593         m_rs.updateArray(arg0, arg1);
594     }
595
596
597     /* (non-Javadoc)
598      * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
599      */

600     public void updateArray(String JavaDoc arg0, Array arg1) throws SQLException {
601         m_rs.updateArray(arg0, arg1);
602     }
603
604
605     /* (non-Javadoc)
606      * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
607      */

608     public void updateAsciiStream(int arg0, InputStream arg1, int arg2)
609         throws SQLException {
610         m_rs.updateAsciiStream(arg0, arg1, arg2);
611     }
612
613
614     /* (non-Javadoc)
615      * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
616      */

617     public void updateAsciiStream(String JavaDoc arg0, InputStream arg1, int arg2)
618         throws SQLException {
619         m_rs.updateAsciiStream(arg0, arg1, arg2);
620     }
621
622
623     /* (non-Javadoc)
624      * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
625      */

626     public void updateBigDecimal(int arg0, BigDecimal JavaDoc arg1)
627         throws SQLException {
628         m_rs.updateBigDecimal(arg0, arg1);
629     }
630
631
632     /* (non-Javadoc)
633      * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
634      */

635     public void updateBigDecimal(String JavaDoc arg0, BigDecimal JavaDoc arg1)
636         throws SQLException {
637         m_rs.updateBigDecimal(arg0, arg1);
638     }
639
640
641     /* (non-Javadoc)
642      * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
643      */

644     public void updateBinaryStream(int arg0, InputStream arg1, int arg2)
645         throws SQLException {
646         m_rs.updateBinaryStream(arg0, arg1, arg2);
647     }
648
649
650     /* (non-Javadoc)
651      * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
652      */

653     public void updateBinaryStream(String JavaDoc arg0, InputStream arg1, int arg2)
654         throws SQLException {
655         m_rs.updateBinaryStream(arg0, arg1, arg2);
656     }
657
658
659     /* (non-Javadoc)
660      * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
661      */

662     public void updateBlob(int arg0, Blob arg1) throws SQLException {
663         m_rs.updateBlob(arg0, arg1);
664     }
665
666     /* (non-Javadoc)
667      * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
668      */

669     public void updateBlob(String JavaDoc arg0, Blob arg1) throws SQLException {
670         m_rs.updateBlob(arg0, arg1);
671     }
672
673     /* (non-Javadoc)
674      * @see java.sql.ResultSet#updateBoolean(int, boolean)
675      */

676     public void updateBoolean(int arg0, boolean arg1) throws SQLException {
677         m_rs.updateBoolean(arg0, arg1);
678     }
679
680     /* (non-Javadoc)
681      * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
682      */

683     public void updateBoolean(String JavaDoc arg0, boolean arg1) throws SQLException {
684         m_rs.updateBoolean(arg0, arg1);
685     }
686
687     /* (non-Javadoc)
688      * @see java.sql.ResultSet#updateByte(int, byte)
689      */

690     public void updateByte(int arg0, byte arg1) throws SQLException {
691         m_rs.updateByte(arg0, arg1);
692     }
693
694     /* (non-Javadoc)
695      * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
696      */

697     public void updateByte(String JavaDoc arg0, byte arg1) throws SQLException {
698         m_rs.updateByte(arg0, arg1);
699     }
700
701     /* (non-Javadoc)
702      * @see java.sql.ResultSet#updateBytes(int, byte[])
703      */

704     public void updateBytes(int arg0, byte[] arg1) throws SQLException {
705         m_rs.updateBytes(arg0, arg1);
706     }
707
708     /* (non-Javadoc)
709      * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
710      */

711     public void updateBytes(String JavaDoc arg0, byte[] arg1) throws SQLException {
712         m_rs.updateBytes(arg0, arg1);
713     }
714
715     /* (non-Javadoc)
716      * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
717      */

718     public void updateCharacterStream(int arg0, Reader arg1, int arg2)
719         throws SQLException {
720         m_rs.updateCharacterStream(arg0, arg1, arg2);
721     }
722
723     /* (non-Javadoc)
724      * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
725      */

726     public void updateCharacterStream(String JavaDoc arg0, Reader arg1, int arg2)
727         throws SQLException {
728         m_rs.updateCharacterStream(arg0, arg1, arg2);
729     }
730
731     /* (non-Javadoc)
732      * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
733      */

734     public void updateClob(int arg0, Clob arg1) throws SQLException {
735         m_rs.updateClob(arg0, arg1);
736     }
737
738     /* (non-Javadoc)
739      * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
740      */

741     public void updateClob(String JavaDoc arg0, Clob arg1) throws SQLException {
742         m_rs.updateClob(arg0, arg1);
743     }
744
745     /* (non-Javadoc)
746      * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
747      */

748     public void updateDate(int arg0, java.sql.Date JavaDoc arg1) throws SQLException {
749         m_rs.updateDate(arg0, arg1);
750     }
751
752     /* (non-Javadoc)
753      * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
754      */

755     public void updateDate(String JavaDoc arg0, java.sql.Date JavaDoc arg1) throws SQLException {
756         m_rs.updateDate(arg0, arg1);
757     }
758
759     /* (non-Javadoc)
760      * @see java.sql.ResultSet#updateDouble(int, double)
761      */

762     public void updateDouble(int arg0, double arg1) throws SQLException {
763         m_rs.updateDouble(arg0, arg1);
764     }
765
766     /* (non-Javadoc)
767      * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
768      */

769     public void updateDouble(String JavaDoc arg0, double arg1) throws SQLException {
770         m_rs.updateDouble(arg0, arg1);
771     }
772
773     /* (non-Javadoc)
774      * @see java.sql.ResultSet#updateFloat(int, float)
775      */

776     public void updateFloat(int arg0, float arg1) throws SQLException {
777         m_rs.updateFloat(arg0, arg1);
778     }
779
780     /* (non-Javadoc)
781      * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
782      */

783     public void updateFloat(String JavaDoc arg0, float arg1) throws SQLException {
784         m_rs.updateFloat(arg0, arg1);
785     }
786
787     /* (non-Javadoc)
788      * @see java.sql.ResultSet#updateInt(int, int)
789      */

790     public void updateInt(int arg0, int arg1) throws SQLException {
791         m_rs.updateInt(arg0, arg1);
792     }
793
794     /* (non-Javadoc)
795      * @see java.sql.ResultSet#updateInt(java.lang.String, int)
796      */

797     public void updateInt(String JavaDoc arg0, int arg1) throws SQLException {
798         m_rs.updateInt(arg0, arg1);
799     }
800
801     /* (non-Javadoc)
802      * @see java.sql.ResultSet#updateLong(int, long)
803      */

804     public void updateLong(int arg0, long arg1) throws SQLException {
805         m_rs.updateLong(arg0, arg1);
806     }
807
808     /* (non-Javadoc)
809      * @see java.sql.ResultSet#updateLong(java.lang.String, long)
810      */

811     public void updateLong(String JavaDoc arg0, long arg1) throws SQLException {
812         m_rs.updateLong(arg0, arg1);
813     }
814
815     /* (non-Javadoc)
816      * @see java.sql.ResultSet#updateNull(int)
817      */

818     public void updateNull(int arg0) throws SQLException {
819         m_rs.updateNull(arg0);
820     }
821
822     /* (non-Javadoc)
823      * @see java.sql.ResultSet#updateNull(java.lang.String)
824      */

825     public void updateNull(String JavaDoc arg0) throws SQLException {
826         m_rs.updateNull(arg0);
827     }
828
829     /* (non-Javadoc)
830      * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
831      */

832     public void updateObject(int arg0, Object JavaDoc arg1) throws SQLException {
833         m_rs.updateObject(arg0, arg1);
834     }
835
836     /* (non-Javadoc)
837      * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
838      */

839     public void updateObject(int arg0, Object JavaDoc arg1, int arg2)
840         throws SQLException {
841         m_rs.updateObject(arg0, arg1, arg2);
842     }
843
844     /* (non-Javadoc)
845      * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
846      */

847     public void updateObject(String JavaDoc arg0, Object JavaDoc arg1) throws SQLException {
848         m_rs.updateObject(arg0, arg1);
849     }
850
851     /* (non-Javadoc)
852      * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
853      */

854     public void updateObject(String JavaDoc arg0, Object JavaDoc arg1, int arg2)
855         throws SQLException {
856         m_rs.updateObject(arg0, arg1, arg2);
857     }
858
859     /* (non-Javadoc)
860      * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
861      */

862     public void updateRef(int arg0, Ref arg1) throws SQLException {
863         m_rs.updateRef(arg0, arg1);
864     }
865
866     /* (non-Javadoc)
867      * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
868      */

869     public void updateRef(String JavaDoc arg0, Ref arg1) throws SQLException {
870         m_rs.updateRef(arg0, arg1);
871     }
872
873     /* (non-Javadoc)
874      * @see java.sql.ResultSet#updateRow()
875      */

876     public void updateRow() throws SQLException {
877         m_rs.updateRow();
878     }
879
880     /* (non-Javadoc)
881      * @see java.sql.ResultSet#updateShort(int, short)
882      */

883     public void updateShort(int arg0, short arg1) throws SQLException {
884         m_rs.updateShort(arg0, arg1);
885     }
886
887     /* (non-Javadoc)
888      * @see java.sql.ResultSet#updateShort(java.lang.String, short)
889      */

890     public void updateShort(String JavaDoc arg0, short arg1) throws SQLException {
891         m_rs.updateShort(arg0, arg1);
892     }
893
894     /* (non-Javadoc)
895      * @see java.sql.ResultSet#updateString(int, java.lang.String)
896      */

897     public void updateString(int arg0, String JavaDoc arg1) throws SQLException {
898         m_rs.updateString(arg0, arg1);
899     }
900
901     /* (non-Javadoc)
902      * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
903      */

904     public void updateString(String JavaDoc arg0, String JavaDoc arg1) throws SQLException {
905         m_rs.updateString(arg0, arg1);
906     }
907
908
909     /* (non-Javadoc)
910      * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
911      */

912     public void updateTime(int arg0, Time arg1) throws SQLException {
913         m_rs.updateTime(arg0, arg1);
914     }
915
916     /* (non-Javadoc)
917      * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
918      */

919     public void updateTime(String JavaDoc arg0, Time arg1) throws SQLException {
920         m_rs.updateTime(arg0, arg1);
921     }
922
923     /* (non-Javadoc)
924      * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
925      */

926     public void updateTimestamp(int arg0, Timestamp arg1) throws SQLException {
927         m_rs.updateTimestamp(arg0, arg1);
928     }
929
930     /* (non-Javadoc)
931      * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
932      */

933     public void updateTimestamp(String JavaDoc arg0, Timestamp arg1)
934         throws SQLException {
935         m_rs.updateTimestamp(arg0, arg1);
936     }
937
938     /* (non-Javadoc)
939      * @see java.sql.ResultSet#getTimestamp(int)
940      */

941     public Timestamp getTimestamp(int arg0) throws SQLException {
942         return m_rs.getTimestamp(arg0);
943     }
944
945     /* (non-Javadoc)
946      * @see java.sql.ResultSet#getBoolean(java.lang.String)
947      */

948     public boolean getBoolean(String JavaDoc arg0) throws SQLException {
949         return m_rs.getBoolean(arg0);
950     }
951
952     /* (non-Javadoc)
953      * @see java.sql.ResultSet#getObject(int)
954      */

955     public Object JavaDoc getObject(int arg0) throws SQLException {
956         return m_rs.getObject(arg0);
957     }
958
959     /* (non-Javadoc)
960      * @see java.sql.ResultSet#getTime(int)
961      */

962     public Time getTime(int arg0) throws SQLException {
963         return m_rs.getTime(arg0);
964     }
965
966     /* (non-Javadoc)
967      * @see java.sql.ResultSet#getBytes(int)
968      */

969     public byte[] getBytes(int arg0) throws SQLException {
970         return m_rs.getBytes(arg0);
971     }
972
973     /* (non-Javadoc)
974      * @see java.sql.ResultSet#getBytes(java.lang.String)
975      */

976     public byte[] getBytes(String JavaDoc arg0) throws SQLException {
977         return m_rs.getBytes(arg0);
978     }
979
980     /* (non-Javadoc)
981      * @see java.sql.ResultSet#getCursorName()
982      */

983     public String JavaDoc getCursorName() throws SQLException {
984         return m_rs.getCursorName();
985     }
986
987     /* (non-Javadoc)
988      * @see java.sql.ResultSet#clearWarnings()
989      */

990     public void clearWarnings() throws SQLException {
991         m_rs.clearWarnings();
992     }
993
994     /* (non-Javadoc)
995      * @see java.sql.ResultSet#getUnicodeStream(int)
996      */

997     public InputStream getUnicodeStream(int arg0) throws SQLException {
998         return m_rs.getUnicodeStream(arg0);
999     }
1000
1001    /* (non-Javadoc)
1002     * @see java.sql.ResultSet#getLong(java.lang.String)
1003     */

1004    public long getLong(String JavaDoc arg0) throws SQLException {
1005        return m_rs.getLong(arg0);
1006    }
1007
1008    /* (non-Javadoc)
1009     * @see java.sql.ResultSet#getMetaData()
1010     */

1011    public ResultSetMetaData getMetaData() throws SQLException {
1012        return m_rs.getMetaData();
1013    }
1014
1015    /* (non-Javadoc)
1016     * @see java.sql.ResultSet#getBigDecimal(int, int)
1017     */

1018    public BigDecimal JavaDoc getBigDecimal(int arg0, int arg1) throws SQLException {
1019        return m_rs.getBigDecimal(arg0, arg1);
1020    }
1021
1022    /* (non-Javadoc)
1023     * @see java.sql.ResultSet#getFloat(int)
1024     */

1025    public float getFloat(int arg0) throws SQLException {
1026        return m_rs.getFloat(arg0);
1027    }
1028
1029    /* (non-Javadoc)
1030     * @see java.sql.ResultSet#findColumn(java.lang.String)
1031     */

1032    public int findColumn(String JavaDoc arg0) throws SQLException {
1033        return m_rs.findColumn(arg0);
1034    }
1035
1036    /* (non-Javadoc)
1037     * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int)
1038     */

1039    public BigDecimal JavaDoc getBigDecimal(String JavaDoc arg0, int arg1)
1040        throws SQLException {
1041        return m_rs.getBigDecimal(arg0, arg1);
1042    }
1043
1044    /* (non-Javadoc)
1045     * @see java.sql.ResultSet#getTimestamp(java.lang.String)
1046     */

1047    public Timestamp getTimestamp(String JavaDoc arg0) throws SQLException {
1048        return m_rs.getTimestamp(arg0);
1049    }
1050
1051    /* (non-Javadoc)
1052     * @see java.sql.ResultSet#getDouble(java.lang.String)
1053     */

1054    public double getDouble(String JavaDoc arg0) throws SQLException {
1055        return m_rs.getDouble(arg0);
1056    }
1057
1058    /* (non-Javadoc)
1059     * @see java.sql.ResultSet#getInt(java.lang.String)
1060     */

1061    public int getInt(String JavaDoc str) throws SQLException {
1062        String JavaDoc sKey = this.getCacheKey(str);
1063        Integer JavaDoc intResult = null;
1064        
1065        if(m_rowcache.size() > 0) {
1066            intResult = (Integer JavaDoc) m_rowcache.get(sKey);
1067        }
1068
1069        if(intResult == null) {
1070            intResult = new Integer JavaDoc(m_rs.getInt(str));
1071            if(intResult != null) {
1072                m_rowcache.put(sKey, intResult);
1073            }
1074        }
1075        
1076        return intResult.intValue();
1077    }
1078
1079    /* (non-Javadoc)
1080     * @see java.sql.ResultSet#getDate(java.lang.String)
1081     */

1082    public java.sql.Date JavaDoc getDate(String JavaDoc arg0) throws SQLException {
1083        return m_rs.getDate(arg0);
1084    }
1085
1086    /* (non-Javadoc)
1087     * @see java.sql.ResultSet#getTime(java.lang.String)
1088     */

1089    public Time getTime(String JavaDoc arg0) throws SQLException {
1090        return m_rs.getTime(arg0);
1091    }
1092
1093    /* (non-Javadoc)
1094     * @see java.sql.ResultSet#getShort(java.lang.String)
1095     */

1096    public short getShort(String JavaDoc arg0) throws SQLException {
1097        return m_rs.getShort(arg0);
1098    }
1099
1100    /* (non-Javadoc)
1101     * @see java.sql.ResultSet#getAsciiStream(java.lang.String)
1102     */

1103    public InputStream getAsciiStream(String JavaDoc arg0) throws SQLException {
1104        return m_rs.getAsciiStream(arg0);
1105    }
1106
1107    /* (non-Javadoc)
1108     * @see java.sql.ResultSet#wasNull()
1109     */

1110    public boolean wasNull() throws SQLException {
1111        return m_rs.wasNull();
1112    }
1113
1114    /* (non-Javadoc)
1115     * @see java.sql.ResultSet#getBinaryStream(int)
1116     */

1117    public InputStream getBinaryStream(int arg0) throws SQLException {
1118        return m_rs.getBinaryStream(arg0);
1119    }
1120
1121    /* (non-Javadoc)
1122     * @see java.sql.ResultSet#getDate(int)
1123     */

1124    public java.sql.Date JavaDoc getDate(int arg0) throws SQLException {
1125        return m_rs.getDate(arg0);
1126    }
1127
1128    /* (non-Javadoc)
1129     * @see java.sql.ResultSet#getWarnings()
1130     */

1131    public SQLWarning getWarnings() throws SQLException {
1132        return m_rs.getWarnings();
1133    }
1134
1135    /* (non-Javadoc)
1136     * @see java.sql.ResultSet#getAsciiStream(int)
1137     */

1138    public InputStream getAsciiStream(int arg0) throws SQLException {
1139        return m_rs.getAsciiStream(arg0);
1140    }
1141
1142    /* (non-Javadoc)
1143     * @see java.sql.ResultSet#getLong(int)
1144     */

1145    public long getLong(int arg0) throws SQLException {
1146        return m_rs.getLong(arg0);
1147    }
1148
1149    /* (non-Javadoc)
1150     * @see java.sql.ResultSet#getUnicodeStream(java.lang.String)
1151     */

1152    public InputStream getUnicodeStream(String JavaDoc arg0) throws SQLException {
1153        return m_rs.getUnicodeStream(arg0);
1154    }
1155
1156    /* (non-Javadoc)
1157     * @see java.sql.ResultSet#getByte(int)
1158     */

1159    public byte getByte(int arg0) throws SQLException {
1160        return m_rs.getByte(arg0);
1161    }
1162
1163    /* (non-Javadoc)
1164     * @see java.sql.ResultSet#getObject(java.lang.String)
1165     */

1166    public Object JavaDoc getObject(String JavaDoc arg0) throws SQLException {
1167        return m_rs.getObject(arg0);
1168    }
1169
1170    /* (non-Javadoc)
1171     * @see java.sql.ResultSet#getInt(int)
1172     */

1173    public int getInt(int n) throws SQLException {
1174        String JavaDoc sKey = this.getCacheKey(n);
1175        Integer JavaDoc intResult = null;
1176        
1177        if(m_rowcache.size() > 0) {
1178            intResult = (Integer JavaDoc) m_rowcache.get(sKey);
1179        }
1180
1181        if(intResult == null) {
1182            intResult = new Integer JavaDoc(m_rs.getInt(n));
1183            if(intResult != null) {
1184                m_rowcache.put(sKey, intResult);
1185            }
1186        }
1187        
1188        return intResult.intValue();
1189    }
1190
1191    /* (non-Javadoc)
1192     * @see java.sql.ResultSet#getShort(int)
1193     */

1194    public short getShort(int arg0) throws SQLException {
1195        return m_rs.getShort(arg0);
1196    }
1197
1198    /* (non-Javadoc)
1199     * @see java.sql.ResultSet#getBoolean(int)
1200     */

1201    public boolean getBoolean(int arg0) throws SQLException {
1202        return m_rs.getBoolean(arg0);
1203    }
1204
1205    /* (non-Javadoc)
1206     * @see java.sql.ResultSet#getFloat(java.lang.String)
1207     */

1208    public float getFloat(String JavaDoc arg0) throws SQLException {
1209        return m_rs.getFloat(arg0);
1210    }
1211
1212    /* (non-Javadoc)
1213     * @see java.sql.ResultSet#getBinaryStream(java.lang.String)
1214     */

1215    public InputStream getBinaryStream(String JavaDoc arg0) throws SQLException {
1216        return m_rs.getBinaryStream(arg0);
1217    }
1218
1219    /* (non-Javadoc)
1220     * @see java.sql.ResultSet#getDouble(int)
1221     */

1222    public double getDouble(int arg0) throws SQLException {
1223        return m_rs.getDouble(arg0);
1224    }
1225
1226    /* (non-Javadoc)
1227     * @see java.sql.ResultSet#getByte(java.lang.String)
1228     */

1229    public byte getByte(String JavaDoc arg0) throws SQLException {
1230        return m_rs.getByte(arg0);
1231    }
1232
1233}
Popular Tags