001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.cfx;
020
021
022import java.io.InputStream;
023import java.io.Reader;
024import java.lang.reflect.Method;
025import java.math.BigDecimal;
026import java.net.URL;
027import java.sql.Array;
028import java.sql.Blob;
029import java.sql.Clob;
030import java.sql.Date;
031import java.sql.NClob;
032import java.sql.Ref;
033import java.sql.ResultSetMetaData;
034import java.sql.RowId;
035import java.sql.SQLException;
036import java.sql.SQLWarning;
037import java.sql.SQLXML;
038import java.sql.Statement;
039import java.sql.Time;
040import java.sql.Timestamp;
041import java.util.Calendar;
042import java.util.Iterator;
043import java.util.Map;
044
045import lucee.runtime.PageContext;
046import lucee.runtime.dump.DumpData;
047import lucee.runtime.dump.DumpProperties;
048import lucee.runtime.exp.PageException;
049import lucee.runtime.type.Collection;
050import lucee.runtime.type.Collection.Key;
051
052import com.allaire.cfx.Query;
053
054/**
055 * Implementation of the Query Interface
056 */
057public class QueryWrap implements Query {
058        
059
060        private lucee.runtime.type.Query rst;
061        private String name;
062
063        /**
064         * constructor of the class
065         * @param rst runtime Query
066         */
067        public QueryWrap(lucee.runtime.type.Query rst) {
068                this.rst=rst;
069                this.name=rst.getName();
070        }
071        /**
072         * constructor of the class
073         * @param rst runtime Query
074         * @param name name of the query (otherwise rst.getName())
075         */
076        public QueryWrap(lucee.runtime.type.Query rst, String name) {
077                this.rst=rst;
078                this.name=name;
079        }
080
081        /**
082         * @see com.allaire.cfx.Query#addRow()
083         */
084        public int addRow() {
085                return rst.addRow();
086        }
087
088        /**
089         * @see com.allaire.cfx.Query#getColumnIndex(java.lang.String)
090         */
091        public int getColumnIndex(String coulmnName) {
092                return rst.getColumnIndex(coulmnName);
093        }
094
095        /**
096         * @see com.allaire.cfx.Query#getColumns()
097         */
098        public String[] getColumns() {
099                return rst.getColumns();
100        }
101        
102        public Collection.Key[] getColumnNames() {
103        return rst.getColumnNames();
104    }
105    
106
107        public String[] getColumnNamesAsString() {
108                return rst.getColumnNamesAsString();
109        }
110
111        /**
112         * @see com.allaire.cfx.Query#getData(int, int)
113         */
114        public String getData(int row, int col) throws IndexOutOfBoundsException {
115                return rst.getData(row,col);
116        }
117
118        /**
119         * @see com.allaire.cfx.Query#getName()
120         */
121        public String getName() {
122                return name;
123        }
124
125        /**
126         * @see com.allaire.cfx.Query#getRowCount()
127         */
128        public int getRowCount() {
129                return rst.getRowCount();
130        }
131
132        /**
133         * @see com.allaire.cfx.Query#setData(int, int, java.lang.String)
134         */
135        public void setData(int row, int col, String value) throws IndexOutOfBoundsException {
136            rst.setData(row,col,value);
137        }
138        
139        
140        /**
141         * @see java.sql.ResultSet#absolute(int)
142         */
143        public boolean absolute(int row) throws SQLException {  
144                return rst.absolute(row);
145        }
146        /**
147         * @see java.sql.ResultSet#afterLast()
148         */
149        public void afterLast() throws SQLException {
150                rst.afterLast();
151        }
152        /**
153         * @see java.sql.ResultSet#beforeFirst()
154         */
155        public void beforeFirst() throws SQLException { 
156                rst.beforeFirst();
157        }
158        /**
159         * @see java.sql.ResultSet#cancelRowUpdates()
160         */
161        public void cancelRowUpdates() throws SQLException {    
162                rst.cancelRowUpdates();
163        }
164        /**
165         * @see java.sql.ResultSet#clearWarnings()
166         */
167        public void clearWarnings() throws SQLException {
168                rst.clearWarnings();
169        }
170        
171        /**
172         * @see java.lang.Object#clone()
173         */
174        public Object clone() { 
175                return rst.clone();
176        }
177        /**
178         * @see java.sql.ResultSet#close()
179         */
180        public void close() throws SQLException {       
181                rst.close();
182        }
183        /**
184         * @see java.sql.ResultSet#deleteRow()
185         */
186        public void deleteRow() throws SQLException {   
187                rst.deleteRow();
188        }
189        /**
190         * @see java.sql.ResultSet#findColumn(java.lang.String)
191         */
192        public int findColumn(String columnName) throws SQLException {
193                return rst.findColumn(columnName);
194        }
195        /**
196         * @see java.sql.ResultSet#first()
197         */
198        public boolean first() throws SQLException {    
199                return rst.first();
200        }
201        /**
202         * @see java.sql.ResultSet#getArray(int)
203         */
204        public Array getArray(int i) throws SQLException {
205                return rst.getArray(i);
206        }
207        /**
208         * @see java.sql.ResultSet#getArray(java.lang.String)
209         */
210        public Array getArray(String colName) throws SQLException {
211                return rst.getArray(colName);
212        }
213        /**
214         * @see java.sql.ResultSet#getAsciiStream(int)
215         */
216        public InputStream getAsciiStream(int columnIndex) throws SQLException {
217                return rst.getAsciiStream(columnIndex);
218        }
219        /**
220         * @see java.sql.ResultSet#getAsciiStream(java.lang.String)
221         */
222        public InputStream getAsciiStream(String columnName) throws SQLException {      
223                return rst.getAsciiStream(columnName);
224        }
225        /**
226         * @see java.sql.ResultSet#getBigDecimal(int, int)
227         */
228        public BigDecimal getBigDecimal(int columnIndex, int scale)throws SQLException {
229                return rst.getBigDecimal(columnIndex, scale);
230        }
231        /**
232         * @see java.sql.ResultSet#getBigDecimal(int)
233         */
234        public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
235                return rst.getBigDecimal(columnIndex);
236        }
237        /**
238         * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int)
239         */
240        public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
241                return rst.getBigDecimal(columnName, scale);
242        }
243        /**
244         * @see java.sql.ResultSet#getBigDecimal(java.lang.String)
245         */
246        public BigDecimal getBigDecimal(String columnName) throws SQLException {
247                return rst.getBigDecimal(columnName);
248        }
249        /**
250         * @see java.sql.ResultSet#getBinaryStream(int)
251         */
252        public InputStream getBinaryStream(int columnIndex) throws SQLException {
253                return rst.getBinaryStream(columnIndex);
254        }
255        /**
256         * @see java.sql.ResultSet#getBinaryStream(java.lang.String)
257         */
258        public InputStream getBinaryStream(String columnName) throws SQLException {
259                return rst.getBinaryStream(columnName);
260        }
261        /**
262         * @see java.sql.ResultSet#getBlob(int)
263         */
264        public Blob getBlob(int i) throws SQLException {
265                return rst.getBlob(i);
266        }
267        /**
268         * @see java.sql.ResultSet#getBlob(java.lang.String)
269         */
270        public Blob getBlob(String colName) throws SQLException {
271                return rst.getBlob(colName);
272        }
273        /**
274         * @see java.sql.ResultSet#getBoolean(int)
275         */
276        public boolean getBoolean(int columnIndex) throws SQLException {
277                return rst.getBoolean(columnIndex);
278        }
279        /**
280         * @see java.sql.ResultSet#getBoolean(java.lang.String)
281         */
282        public boolean getBoolean(String columnName) throws SQLException {
283                return rst.getBoolean(columnName);
284        }
285        /**
286         * @see java.sql.ResultSet#getByte(int)
287         */
288        public byte getByte(int columnIndex) throws SQLException {
289                return rst.getByte(columnIndex);
290        }
291        /**
292         * @see java.sql.ResultSet#getByte(java.lang.String)
293         */
294        public byte getByte(String columnName) throws SQLException {
295                return rst.getByte(columnName);
296        }
297        /**
298         * @see java.sql.ResultSet#getBytes(int)
299         */
300        public byte[] getBytes(int columnIndex) throws SQLException {
301                return rst.getBytes(columnIndex);
302        }
303        /**
304         * @see java.sql.ResultSet#getBytes(java.lang.String)
305         */
306        public byte[] getBytes(String columnName) throws SQLException {
307                return rst.getBytes(columnName);
308        }
309        /**
310         * @see java.sql.ResultSet#getCharacterStream(int)
311         */
312        public Reader getCharacterStream(int columnIndex) throws SQLException { 
313                return rst.getCharacterStream(columnIndex);
314        }
315        /**
316         * @see java.sql.ResultSet#getCharacterStream(java.lang.String)
317         */
318        public Reader getCharacterStream(String columnName) throws SQLException {
319                return rst.getCharacterStream(columnName);
320        }
321        /**
322         * @see java.sql.ResultSet#getClob(int)
323         */
324        public Clob getClob(int i) throws SQLException {        
325                return rst.getClob(i);
326        }
327        /**
328         * @see java.sql.ResultSet#getClob(java.lang.String)
329         */
330        public Clob getClob(String colName) throws SQLException {
331                return rst.getClob(colName);
332        }
333        /**
334         * @see java.sql.ResultSet#getConcurrency()
335         */
336        public int getConcurrency() throws SQLException {       
337                return rst.getConcurrency();
338        }
339        /**
340         * @see java.sql.ResultSet#getCursorName()
341         */
342        public String getCursorName() throws SQLException {
343                return rst.getCursorName();
344        }
345        /**
346         * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
347         */
348        public Date getDate(int columnIndex, Calendar cal) throws SQLException {
349                return rst.getDate(columnIndex, cal);
350        }
351        /**
352         * @see java.sql.ResultSet#getDate(int)
353         */
354        public Date getDate(int columnIndex) throws SQLException {
355                return rst.getDate(columnIndex);
356        }
357        /**
358         * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)
359         */
360        public Date getDate(String columnName, Calendar cal) throws SQLException {
361                return rst.getDate(columnName, cal);
362        }
363        /**
364         * @see java.sql.ResultSet#getDate(java.lang.String)
365         */
366        public Date getDate(String columnName) throws SQLException {
367                return rst.getDate(columnName);
368        }
369        /**
370         * @see java.sql.ResultSet#getDouble(int)
371         */
372        public double getDouble(int columnIndex) throws SQLException {
373                return rst.getDouble(columnIndex);
374        }
375        /**
376         * @see java.sql.ResultSet#getDouble(java.lang.String)
377         */
378        public double getDouble(String columnName) throws SQLException {
379                return rst.getDouble(columnName);
380        }
381        /**
382         * @see java.sql.ResultSet#getFetchDirection()
383         */
384        public int getFetchDirection() throws SQLException {
385                return rst.getFetchDirection();
386        }
387        /**
388         * @see java.sql.ResultSet#getFetchSize()
389         */
390        public int getFetchSize() throws SQLException {
391                return rst.getFetchSize();
392        }
393        /**
394         * @see java.sql.ResultSet#getFloat(int)
395         */
396        public float getFloat(int columnIndex) throws SQLException {
397                return rst.getFloat(columnIndex);
398        }
399        /**
400         * @see java.sql.ResultSet#getFloat(java.lang.String)
401         */
402        public float getFloat(String columnName) throws SQLException {
403                return rst.getFloat(columnName);
404        }
405        /**
406         * @see java.sql.ResultSet#getInt(int)
407         */
408        public int getInt(int columnIndex) throws SQLException {
409                return rst.getInt(columnIndex);
410        }
411        /**
412         * @see java.sql.ResultSet#getInt(java.lang.String)
413         */
414        public int getInt(String columnName) throws SQLException {
415                return rst.getInt(columnName);
416        }
417        /**
418         * @see java.sql.ResultSet#getLong(int)
419         */
420        public long getLong(int columnIndex) throws SQLException {
421                return rst.getLong(columnIndex);
422        }
423        /**
424         * @see java.sql.ResultSet#getLong(java.lang.String)
425         */
426        public long getLong(String columnName) throws SQLException {
427                return rst.getLong(columnName);
428        }
429        /**
430         * @see java.sql.ResultSet#getMetaData()
431         */
432        public ResultSetMetaData getMetaData() throws SQLException {    
433                return rst.getMetaData();
434        }
435        /**
436         * @see java.sql.ResultSet#getObject(int, java.util.Map)
437         */
438        public Object getObject(int i, Map map) throws SQLException {
439                return rst.getObject(i, map);
440        }
441        /**
442         * @see java.sql.ResultSet#getObject(int)
443         */
444        public Object getObject(int columnIndex) throws SQLException {
445                return rst.getObject(columnIndex);
446        }
447        /**
448         * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map)
449         */
450        public Object getObject(String colName, Map map) throws SQLException {
451                return rst.getObject(colName, map);
452        }
453        /**
454         * @see java.sql.ResultSet#getObject(java.lang.String)
455         */
456        public Object getObject(String columnName) throws SQLException {
457                return rst.getObject(columnName);
458        }
459        /**
460         * @return recordcount of the query
461         */
462        public int getRecordcount() {
463                return rst.getRecordcount();
464        }
465        /**
466         * @see java.sql.ResultSet#getRef(int)
467         */
468        public Ref getRef(int i) throws SQLException {
469                return rst.getRef(i);
470        }
471        /**
472         * @see java.sql.ResultSet#getRef(java.lang.String)
473         */
474        public Ref getRef(String colName) throws SQLException {
475                return rst.getRef(colName);
476        }
477        /**
478         * @see java.sql.ResultSet#getRow()
479         */
480        public int getRow() throws SQLException {
481                return rst.getRow();
482        }
483        /**
484         * @see java.sql.ResultSet#getShort(int)
485         */
486        public short getShort(int columnIndex) throws SQLException {
487                return rst.getShort(columnIndex);
488        }
489        /**
490         * @see java.sql.ResultSet#getShort(java.lang.String)
491         */
492        public short getShort(String columnName) throws SQLException {  
493                return rst.getShort(columnName);
494        }
495        /**
496         * @see java.sql.ResultSet#getStatement()
497         */
498        public Statement getStatement() throws SQLException {
499                return rst.getStatement();
500        }
501        /**
502         * @see java.sql.ResultSet#getString(int)
503         */
504        public String getString(int columnIndex) throws SQLException {
505                return rst.getString(columnIndex);
506        }
507        /**
508         * @see java.sql.ResultSet#getString(java.lang.String)
509         */
510        public String getString(String columnName) throws SQLException {
511                return rst.getString(columnName);
512        }
513        /**
514         * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
515         */
516        public Time getTime(int columnIndex, Calendar cal) throws SQLException {
517                return rst.getTime(columnIndex, cal);
518        }
519        /**
520         * @see java.sql.ResultSet#getTime(int)
521         */
522        public Time getTime(int columnIndex) throws SQLException {
523                return rst.getTime(columnIndex);
524        }
525        /**
526         * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)
527         */
528        public Time getTime(String columnName, Calendar cal) throws SQLException {
529                return rst.getTime(columnName, cal);
530        }
531        /**
532         * @see java.sql.ResultSet#getTime(java.lang.String)
533         */
534        public Time getTime(String columnName) throws SQLException {
535                return rst.getTime(columnName);
536        }
537        /**
538         * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
539         */
540        public Timestamp getTimestamp(int columnIndex, Calendar cal)throws SQLException {       
541                return rst.getTimestamp(columnIndex, cal);
542        }
543        /**
544         * @see java.sql.ResultSet#getTimestamp(int)
545         */
546        public Timestamp getTimestamp(int columnIndex) throws SQLException {
547                return rst.getTimestamp(columnIndex);
548        }
549        /**
550         * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)
551         */
552        public Timestamp getTimestamp(String columnName, Calendar cal)
553                        throws SQLException {
554                return rst.getTimestamp(columnName, cal);
555        }
556        /**
557         * @see java.sql.ResultSet#getTimestamp(java.lang.String)
558         */
559        public Timestamp getTimestamp(String columnName) throws SQLException {
560                return rst.getTimestamp(columnName);
561        }
562        /**
563         * @see java.sql.ResultSet#getType()
564         */
565        public int getType() throws SQLException {      
566                return rst.getType();
567        }
568        /**
569         * @see java.sql.ResultSet#getUnicodeStream(int)
570         */
571        public InputStream getUnicodeStream(int columnIndex) throws SQLException {
572                return rst.getUnicodeStream(columnIndex);
573        }
574        /**
575         * @see java.sql.ResultSet#getUnicodeStream(java.lang.String)
576         */
577        public InputStream getUnicodeStream(String columnName) throws SQLException {
578                return rst.getUnicodeStream(columnName);
579        }
580        /**
581         * @see java.sql.ResultSet#getURL(int)
582         */
583        public URL getURL(int columnIndex) throws SQLException {
584                return rst.getURL(columnIndex);
585        }
586        /**
587         * @see java.sql.ResultSet#getURL(java.lang.String)
588         */
589        public URL getURL(String columnName) throws SQLException {
590                return rst.getURL(columnName);
591        }
592        /**
593         * @see java.sql.ResultSet#getWarnings()
594         */
595        public SQLWarning getWarnings() throws SQLException {
596                return rst.getWarnings();
597        }
598        /**
599         * @see java.sql.ResultSet#insertRow()
600         */
601        public void insertRow() throws SQLException {
602                rst.insertRow();
603        }
604        /**
605         * @see java.sql.ResultSet#isAfterLast()
606         */
607        public boolean isAfterLast() throws SQLException {
608                
609                return rst.isAfterLast();
610        }
611        /**
612         * @see java.sql.ResultSet#isBeforeFirst()
613         */
614        public boolean isBeforeFirst() throws SQLException {
615                return rst.isBeforeFirst();
616        }
617        /**
618         * @return is cached
619         */
620        public boolean isCached() {
621                return rst.isCached();
622        }
623        /**
624         * @return has records
625         */
626        public boolean isEmpty() {
627                return rst.isEmpty();
628        }
629        /**
630         * @see java.sql.ResultSet#isFirst()
631         */
632        public boolean isFirst() throws SQLException {
633                return rst.isFirst();
634        }
635        /**
636         * @see java.sql.ResultSet#isLast()
637         */
638        public boolean isLast() throws SQLException {
639                return rst.isLast();
640        }
641        
642        /**
643         * @return iterator for he keys
644         */
645        public Iterator<Collection.Key> keyIterator() {
646                return rst.keyIterator();
647        }
648        
649        /**
650         * @return all keys of the Query
651         */
652        public Key[] keys() {
653                return rst.keys();
654        }
655        /**
656         * @see java.sql.ResultSet#last()
657         */
658        public boolean last() throws SQLException {
659                
660                return rst.last();
661        }
662        
663        
664        
665        /**
666         * @see java.sql.ResultSet#moveToCurrentRow()
667         */
668        public void moveToCurrentRow() throws SQLException {
669                rst.moveToCurrentRow();
670        }
671        /**
672         * @see java.sql.ResultSet#moveToInsertRow()
673         */
674        public void moveToInsertRow() throws SQLException {
675                rst.moveToInsertRow();
676        }
677        /**
678         * @see java.sql.ResultSet#next()
679         */
680        public boolean next() {
681                return rst.next();
682        }
683        /**
684         * @see java.sql.ResultSet#previous()
685         */
686        public boolean previous()  throws SQLException{
687                return rst.previous();
688        }
689        /**
690         * @see java.sql.ResultSet#refreshRow()
691         */
692        public void refreshRow() throws SQLException {
693                rst.refreshRow();
694        }
695        /**
696         * @see java.sql.ResultSet#relative(int)
697         */
698        public boolean relative(int rows) throws SQLException {
699                return rst.relative(rows);
700        }
701        /**
702         * @see java.sql.ResultSet#rowDeleted()
703         */
704        public boolean rowDeleted() throws SQLException {
705                return rst.rowDeleted();
706        }
707        /**
708         * @see java.sql.ResultSet#rowInserted()
709         */
710        public boolean rowInserted() throws SQLException {
711                return rst.rowInserted();
712        }
713        /**
714         * @see java.sql.ResultSet#rowUpdated()
715         */
716        public boolean rowUpdated() throws SQLException {
717                return rst.rowUpdated();
718        }
719        
720        /**
721         * @see java.sql.ResultSet#setFetchDirection(int)
722         */
723        public void setFetchDirection(int direction) throws SQLException {
724                rst.setFetchDirection(direction);
725        }
726        /**
727         * @see java.sql.ResultSet#setFetchSize(int)
728         */
729        public void setFetchSize(int rows) throws SQLException {
730                rst.setFetchSize(rows);
731        }
732        
733        /**
734         * @return the size of the query
735         */
736        public int size() {     
737                return rst.size();
738        }
739        /**
740         * @param keyColumn
741         * @param order
742         * @throws PageException
743         */
744        public synchronized void sort(Key keyColumn, int order)
745                        throws PageException {
746                
747                rst.sort(keyColumn, order);
748        }
749        /**
750         * @param column
751         * @throws PageException
752         */
753        public void sort(Key column) throws PageException {
754                
755                rst.sort(column);
756        }
757        /**
758         * @param strColumn
759         * @param order
760         * @throws PageException
761         */
762        public synchronized void sort(String strColumn, int order)
763                        throws PageException {
764                
765                rst.sort(strColumn, order);
766        }
767        /**
768         * @param column
769         * @throws PageException
770         */
771        public void sort(String column) throws PageException {
772                
773                rst.sort(column);
774        }
775        /**
776         * @param pageContext
777         * @param maxlevel
778         * @param dp
779         * @return generated DumpData
780         */
781        public DumpData toDumpData(PageContext pageContext, int maxlevel,DumpProperties dp) {
782                return rst.toDumpData(pageContext, maxlevel, dp);
783        }
784        /**
785         * @see java.lang.Object#toString()
786         */
787        public String toString() {
788                return rst.toString();
789        }
790        /**
791         * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
792         */
793        public void updateArray(int columnIndex, Array x) throws SQLException {
794                rst.updateArray(columnIndex, x);
795        }
796        /**
797         * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
798         */
799        public void updateArray(String columnName, Array x) throws SQLException {
800                rst.updateArray(columnName, x);
801        }
802        /**
803         * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
804         */
805        public void updateAsciiStream(int columnIndex, InputStream x, int length)
806                        throws SQLException {
807                rst.updateAsciiStream(columnIndex, x, length);
808        }
809        /**
810         * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
811         */
812        public void updateAsciiStream(String columnName, InputStream x, int length)
813                        throws SQLException {
814                
815                rst.updateAsciiStream(columnName, x, length);
816        }
817        /**
818         * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
819         */
820        public void updateBigDecimal(int columnIndex, BigDecimal x)
821                        throws SQLException {
822                
823                rst.updateBigDecimal(columnIndex, x);
824        }
825        /**
826         * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
827         */
828        public void updateBigDecimal(String columnName, BigDecimal x)
829                        throws SQLException {
830                
831                rst.updateBigDecimal(columnName, x);
832        }
833        /**
834         * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
835         */
836        public void updateBinaryStream(int columnIndex, InputStream x, int length)
837                        throws SQLException {
838                
839                rst.updateBinaryStream(columnIndex, x, length);
840        }
841        /**
842         * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
843         */
844        public void updateBinaryStream(String columnName, InputStream x, int length)
845                        throws SQLException {
846                
847                rst.updateBinaryStream(columnName, x, length);
848        }
849        /**
850         * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
851         */
852        public void updateBlob(int columnIndex, Blob x) throws SQLException {
853                
854                rst.updateBlob(columnIndex, x);
855        }
856        /**
857         * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
858         */
859        public void updateBlob(String columnName, Blob x) throws SQLException {
860                
861                rst.updateBlob(columnName, x);
862        }
863        /**
864         * @see java.sql.ResultSet#updateBoolean(int, boolean)
865         */
866        public void updateBoolean(int columnIndex, boolean x) throws SQLException {
867                
868                rst.updateBoolean(columnIndex, x);
869        }
870        /**
871         * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
872         */
873        public void updateBoolean(String columnName, boolean x) throws SQLException {
874                
875                rst.updateBoolean(columnName, x);
876        }
877        /**
878         * @see java.sql.ResultSet#updateByte(int, byte)
879         */
880        public void updateByte(int columnIndex, byte x) throws SQLException {
881                
882                rst.updateByte(columnIndex, x);
883        }
884        /**
885         * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
886         */
887        public void updateByte(String columnName, byte x) throws SQLException {
888                
889                rst.updateByte(columnName, x);
890        }
891        /**
892         * @see java.sql.ResultSet#updateBytes(int, byte[])
893         */
894        public void updateBytes(int columnIndex, byte[] x) throws SQLException {
895                
896                rst.updateBytes(columnIndex, x);
897        }
898        /**
899         * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
900         */
901        public void updateBytes(String columnName, byte[] x) throws SQLException {
902                rst.updateBytes(columnName, x);
903        }
904        /**
905         * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
906         */
907        public void updateCharacterStream(int columnIndex, Reader reader, int length)
908                        throws SQLException {
909                
910                rst.updateCharacterStream(columnIndex, reader, length);
911        }
912        /**
913         * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
914         */
915        public void updateCharacterStream(String columnName, Reader reader,
916                        int length) throws SQLException {
917                rst.updateCharacterStream(columnName, reader, length);
918        }
919        /**
920         * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
921         */
922        public void updateClob(int columnIndex, Clob x) throws SQLException {
923                rst.updateClob(columnIndex, x);
924        }
925        /**
926         * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
927         */
928        public void updateClob(String columnName, Clob x) throws SQLException {
929                rst.updateClob(columnName, x);
930        }
931        /**
932         * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
933         */
934        public void updateDate(int columnIndex, Date x) throws SQLException {   
935                rst.updateDate(columnIndex, x);
936        }
937        /**
938         * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
939         */
940        public void updateDate(String columnName, Date x) throws SQLException {
941                rst.updateDate(columnName, x);
942        }
943        /**
944         * @see java.sql.ResultSet#updateDouble(int, double)
945         */
946        public void updateDouble(int columnIndex, double x) throws SQLException {
947                rst.updateDouble(columnIndex, x);
948        }
949        /**
950         * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
951         */
952        public void updateDouble(String columnName, double x) throws SQLException {
953                rst.updateDouble(columnName, x);
954        }
955        /**
956         * @see java.sql.ResultSet#updateFloat(int, float)
957         */
958        public void updateFloat(int columnIndex, float x) throws SQLException {
959                rst.updateFloat(columnIndex, x);
960        }
961        /**
962         * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
963         */
964        public void updateFloat(String columnName, float x) throws SQLException {
965                rst.updateFloat(columnName, x);
966        }
967        /**
968         * @see java.sql.ResultSet#updateInt(int, int)
969         */
970        public void updateInt(int columnIndex, int x) throws SQLException {
971                rst.updateInt(columnIndex, x);
972        }
973        /**
974         * @see java.sql.ResultSet#updateInt(java.lang.String, int)
975         */
976        public void updateInt(String columnName, int x) throws SQLException {
977                rst.updateInt(columnName, x);
978        }
979        /**
980         * @see java.sql.ResultSet#updateLong(int, long)
981         */
982        public void updateLong(int columnIndex, long x) throws SQLException {
983                rst.updateLong(columnIndex, x);
984        }
985        /**
986         * @see java.sql.ResultSet#updateLong(java.lang.String, long)
987         */
988        public void updateLong(String columnName, long x) throws SQLException {
989                rst.updateLong(columnName, x);
990        }
991        /**
992         * @see java.sql.ResultSet#updateNull(int)
993         */
994        public void updateNull(int columnIndex) throws SQLException {
995                rst.updateNull(columnIndex);
996        }
997        /**
998         * @see java.sql.ResultSet#updateNull(java.lang.String)
999         */
1000        public void updateNull(String columnName) throws SQLException {
1001                rst.updateNull(columnName);
1002        }
1003        /**
1004         * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
1005         */
1006        public void updateObject(int columnIndex, Object x, int scale)
1007                        throws SQLException {
1008                rst.updateObject(columnIndex, x, scale);
1009        }
1010        /**
1011         * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
1012         */
1013        public void updateObject(int columnIndex, Object x) throws SQLException {
1014                rst.updateObject(columnIndex, x);
1015        }
1016        /**
1017         * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
1018         */
1019        public void updateObject(String columnName, Object x, int scale)
1020                        throws SQLException {
1021                rst.updateObject(columnName, x, scale);
1022        }
1023        /**
1024         * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
1025         */
1026        public void updateObject(String columnName, Object x) throws SQLException {
1027                rst.updateObject(columnName, x);
1028        }
1029        /**
1030         * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
1031         */
1032        public void updateRef(int columnIndex, Ref x) throws SQLException {
1033                rst.updateRef(columnIndex, x);
1034        }
1035        /**
1036         * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
1037         */
1038        public void updateRef(String columnName, Ref x) throws SQLException {
1039                rst.updateRef(columnName, x);
1040        }
1041        /**
1042         * @see java.sql.ResultSet#updateRow()
1043         */
1044        public void updateRow() throws SQLException {
1045                rst.updateRow();
1046        }
1047        /**
1048         * @see java.sql.ResultSet#updateShort(int, short)
1049         */
1050        public void updateShort(int columnIndex, short x) throws SQLException {
1051                rst.updateShort(columnIndex, x);
1052        }
1053        /**
1054         * @see java.sql.ResultSet#updateShort(java.lang.String, short)
1055         */
1056        public void updateShort(String columnName, short x) throws SQLException {
1057                rst.updateShort(columnName, x);
1058        }
1059        /**
1060         * @see java.sql.ResultSet#updateString(int, java.lang.String)
1061         */
1062        public void updateString(int columnIndex, String x) throws SQLException {
1063                rst.updateString(columnIndex, x);
1064        }
1065        /**
1066         * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
1067         */
1068        public void updateString(String columnName, String x) throws SQLException {
1069                rst.updateString(columnName, x);
1070        }
1071        /**
1072         * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
1073         */
1074        public void updateTime(int columnIndex, Time x) throws SQLException {
1075                rst.updateTime(columnIndex, x);
1076        }
1077        /**
1078         * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
1079         */
1080        public void updateTime(String columnName, Time x) throws SQLException {
1081                rst.updateTime(columnName, x);
1082        }
1083        /**
1084         * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
1085         */
1086        public void updateTimestamp(int columnIndex, Timestamp x)
1087                        throws SQLException {
1088                rst.updateTimestamp(columnIndex, x);
1089        }
1090        /**
1091         * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
1092         */
1093        public void updateTimestamp(String columnName, Timestamp x)
1094                        throws SQLException {
1095                rst.updateTimestamp(columnName, x);
1096        }
1097        /**
1098         * @see java.sql.ResultSet#wasNull()
1099         */
1100        public boolean wasNull()  throws SQLException{
1101                return rst.wasNull();
1102        }
1103        public lucee.runtime.type.Query getQuery() {
1104                return rst;
1105        }
1106        public int getHoldability() throws SQLException {
1107                throw notSupported();
1108        }
1109        public Reader getNCharacterStream(int arg0) throws SQLException {
1110                throw notSupported();
1111        }
1112        public Reader getNCharacterStream(String arg0) throws SQLException {
1113                throw notSupported();
1114        }
1115        public String getNString(int arg0) throws SQLException {
1116                throw notSupported();
1117        }
1118        public String getNString(String arg0) throws SQLException {
1119                throw notSupported();
1120        }
1121        public boolean isClosed() throws SQLException {
1122                throw notSupported();
1123        }
1124        public void updateAsciiStream(int arg0, InputStream arg1)throws SQLException {
1125                throw notSupported();
1126        }
1127        public void updateAsciiStream(String arg0, InputStream arg1)throws SQLException {
1128                throw notSupported();
1129        }
1130        public void updateAsciiStream(int arg0, InputStream arg1, long arg2)
1131                        throws SQLException {
1132                throw notSupported();
1133        }
1134        public void updateAsciiStream(String arg0, InputStream arg1, long arg2)
1135                        throws SQLException {
1136                throw notSupported();
1137        }
1138        public void updateBinaryStream(int arg0, InputStream arg1)
1139                        throws SQLException {
1140                throw notSupported();
1141        }
1142        public void updateBinaryStream(String arg0, InputStream arg1)
1143                        throws SQLException {
1144                throw notSupported();
1145        }
1146        public void updateBinaryStream(int arg0, InputStream arg1, long arg2)
1147                        throws SQLException {
1148                throw notSupported();
1149        }
1150        public void updateBinaryStream(String arg0, InputStream arg1, long arg2)
1151                        throws SQLException {
1152                throw notSupported();
1153        }
1154        public void updateBlob(int arg0, InputStream arg1) throws SQLException {
1155                throw notSupported();
1156        }
1157        public void updateBlob(String arg0, InputStream arg1) throws SQLException {
1158                throw notSupported();
1159        }
1160        public void updateBlob(int arg0, InputStream arg1, long arg2)
1161                        throws SQLException {
1162                throw notSupported();
1163        }
1164        public void updateBlob(String arg0, InputStream arg1, long arg2)
1165                        throws SQLException {
1166                throw notSupported();
1167        }
1168        public void updateCharacterStream(int arg0, Reader arg1)
1169                        throws SQLException {
1170                throw notSupported();
1171        }
1172        public void updateCharacterStream(String arg0, Reader arg1)
1173                        throws SQLException {
1174                throw notSupported();
1175        }
1176        public void updateCharacterStream(int arg0, Reader arg1, long arg2)
1177                        throws SQLException {
1178                throw notSupported();
1179        }
1180        public void updateCharacterStream(String arg0, Reader arg1, long arg2)
1181                        throws SQLException {
1182                throw notSupported();
1183        }
1184        public void updateClob(int arg0, Reader arg1) throws SQLException {
1185                throw notSupported();
1186        }
1187        public void updateClob(String arg0, Reader arg1) throws SQLException {
1188                throw notSupported();
1189        }
1190        public void updateClob(int arg0, Reader arg1, long arg2)
1191                        throws SQLException {
1192                throw notSupported();
1193        }
1194        public void updateClob(String arg0, Reader arg1, long arg2)
1195                        throws SQLException {
1196                throw notSupported();
1197        }
1198        public void updateNCharacterStream(int arg0, Reader arg1)
1199                        throws SQLException {
1200                throw notSupported();
1201        }
1202        public void updateNCharacterStream(String arg0, Reader arg1)
1203                        throws SQLException {
1204                throw notSupported();
1205        }
1206        public void updateNCharacterStream(int arg0, Reader arg1, long arg2)
1207                        throws SQLException {
1208                throw notSupported();
1209        }
1210        public void updateNCharacterStream(String arg0, Reader arg1, long arg2)
1211                        throws SQLException {
1212                throw notSupported();
1213        }
1214        public void updateNClob(int arg0, Reader arg1) throws SQLException {
1215                throw notSupported();
1216        }
1217        public void updateNClob(String arg0, Reader arg1) throws SQLException {
1218                throw notSupported();
1219        }
1220        public void updateNClob(int arg0, Reader arg1, long arg2)
1221                        throws SQLException {
1222                throw notSupported();
1223        }
1224        public void updateNClob(String arg0, Reader arg1, long arg2)
1225                        throws SQLException {
1226                throw notSupported();
1227        }
1228        public void updateNString(int arg0, String arg1) throws SQLException {
1229                throw notSupported();
1230        }
1231        public void updateNString(String arg0, String arg1) throws SQLException {
1232                throw notSupported();
1233        }
1234        public boolean isWrapperFor(Class<?> arg0) throws SQLException {
1235                throw notSupported();
1236        }
1237        public <T> T unwrap(Class<T> arg0) throws SQLException {
1238                throw notSupported();
1239        }
1240
1241        //JDK6: uncomment this for compiling with JDK6 
1242        public NClob getNClob(int arg0) throws SQLException {
1243                return rst.getNClob(arg0);
1244        }
1245        public NClob getNClob(String arg0) throws SQLException {
1246                return rst.getNClob(arg0);
1247        }
1248        public RowId getRowId(int arg0) throws SQLException {
1249                return rst.getRowId(arg0);
1250        }
1251        public RowId getRowId(String arg0) throws SQLException {
1252                return rst.getRowId(arg0);
1253        }
1254        public SQLXML getSQLXML(int arg0) throws SQLException {
1255                return rst.getSQLXML(arg0);
1256        }
1257        public SQLXML getSQLXML(String arg0) throws SQLException {
1258                return rst.getSQLXML(arg0);
1259        }
1260        public void updateNClob(int arg0, NClob arg1) throws SQLException {
1261                rst.updateNClob(arg0, arg1);
1262        }
1263        public void updateNClob(String arg0, NClob arg1) throws SQLException {
1264                rst.updateNClob(arg0, arg1);
1265        }
1266        public void updateRowId(int arg0, RowId arg1) throws SQLException {
1267                rst.updateRowId(arg0, arg1);
1268        }
1269        public void updateRowId(String arg0, RowId arg1) throws SQLException {
1270                rst.updateRowId(arg0, arg1);
1271        }
1272        public void updateSQLXML(int arg0, SQLXML arg1) throws SQLException {
1273                rst.updateSQLXML(arg0, arg1);
1274        }
1275        public void updateSQLXML(String arg0, SQLXML arg1) throws SQLException {
1276                rst.updateSQLXML(arg0, arg1);
1277        }
1278        
1279        
1280
1281
1282        public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
1283        try {
1284                Method m = rst.getClass().getMethod("getObject", new Class[]{int.class,Class.class});
1285                return (T) m.invoke(rst, new Object[]{columnIndex,type});
1286                } 
1287        catch (Throwable t) {
1288                        if(t instanceof ThreadDeath) throw (ThreadDeath)t;}
1289        throw notSupported();
1290        }
1291        
1292        public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
1293        try {
1294                Method m = rst.getClass().getMethod("getObject", new Class[]{String.class,Class.class});
1295                return (T) m.invoke(rst, new Object[]{columnLabel,type});
1296                } 
1297        catch (Throwable t) {
1298                        if(t instanceof ThreadDeath) throw (ThreadDeath)t;}
1299        throw notSupported();
1300        }
1301
1302        private SQLException notSupported() {
1303                return new SQLException("this feature is not supported");
1304        }
1305        private RuntimeException notSupportedEL() {
1306                return new RuntimeException(new SQLException("this feature is not supported"));
1307        }
1308}