001/*
002 * ModeShape (http://www.modeshape.org)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *       http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.modeshape.jdbc;
017
018import java.io.IOException;
019import java.io.InputStream;
020import java.io.Reader;
021import java.math.BigDecimal;
022import java.net.MalformedURLException;
023import java.net.URL;
024import java.sql.Array;
025import java.sql.Blob;
026import java.sql.Clob;
027import java.sql.Date;
028import java.sql.NClob;
029import java.sql.Ref;
030import java.sql.ResultSet;
031import java.sql.ResultSetMetaData;
032import java.sql.RowId;
033import java.sql.SQLException;
034import java.sql.SQLFeatureNotSupportedException;
035import java.sql.SQLWarning;
036import java.sql.SQLXML;
037import java.sql.Statement;
038import java.sql.Time;
039import java.sql.Timestamp;
040import java.util.Calendar;
041import java.util.Collections;
042import java.util.HashMap;
043import java.util.Map;
044import javax.jcr.Binary;
045import javax.jcr.ItemNotFoundException;
046import javax.jcr.PathNotFoundException;
047import javax.jcr.PropertyType;
048import javax.jcr.RepositoryException;
049import javax.jcr.Value;
050import javax.jcr.ValueFormatException;
051import javax.jcr.query.QueryResult;
052import javax.jcr.query.Row;
053import javax.jcr.query.RowIterator;
054import org.modeshape.common.util.IoUtil;
055import org.modeshape.jdbc.util.TimestampWithTimezone;
056
057/**
058 * 
059 */
060public class JcrResultSet implements ResultSet {
061
062    private boolean closed;
063    private JcrStatement statement;
064    private QueryResult jcrResults;
065    private ResultSetMetaData metadata;
066    private RowIterator rowIter;
067    private Row row;
068
069    // the object which was last read from Results
070    private Object currentValue = null;
071
072    private Map<String, Integer> columnIndexesByName;
073
074    private String[] columnIDs = null;
075
076    protected JcrResultSet( JcrStatement statement,
077                            QueryResult jcrResults,
078                            ResultSetMetaData resultSetMetaData ) throws SQLException {
079        this.statement = statement;
080        this.jcrResults = jcrResults;
081        assert this.statement != null;
082        assert this.jcrResults != null;
083
084        if (resultSetMetaData != null) {
085            this.metadata = resultSetMetaData;
086        } else {
087            this.metadata = new JcrResultSetMetaData(this.statement.connection(), this.jcrResults);
088        }
089        int index = 1; // not zero-based
090        int colCnt = this.metadata.getColumnCount();
091
092        // add 1 because using 1 based location, not zero based, JDBC spec
093        columnIDs = new String[colCnt + 1];
094        columnIndexesByName = new HashMap<String, Integer>(colCnt);
095        while (index <= colCnt) {
096            String name = this.metadata.getColumnName(index);
097            columnIndexesByName.put(name, index);
098            columnIDs[index] = name;
099            index++;
100        }
101
102        this.columnIndexesByName = Collections.unmodifiableMap(columnIndexesByName);
103
104        try {
105            this.rowIter = this.jcrResults.getRows();
106        } catch (RepositoryException e) {
107            throw new SQLException(e.getLocalizedMessage(), e);
108        }
109    }
110
111    protected JcrResultSet() {
112        closed = true;
113        columnIndexesByName = Collections.emptyMap();
114    }
115
116    @Override
117    public boolean isClosed() {
118        return closed || statement.isClosed();
119    }
120
121    @Override
122    public void close() {
123        if (!closed) {
124            closed = true;
125            this.statement.close();
126        }
127    }
128
129    byte[] convertToByteArray( final Value value ) throws SQLException {
130        if (value == null) return null;
131        InputStream is = null;
132        boolean error = false;
133        try {
134            switch (value.getType()) {
135                case PropertyType.STRING:
136                case PropertyType.BOOLEAN:
137                case PropertyType.DOUBLE:
138                case PropertyType.LONG:
139                case PropertyType.DATE:
140                case PropertyType.DECIMAL:
141                    String v = value.getString();
142                    return (v != null ? v.getBytes() : null);
143                case PropertyType.BINARY:
144                    is = value.getBinary().getStream();
145                    return IoUtil.readBytes(is);
146                default:
147                    return null;
148            }
149
150        } catch (IOException ioe) {
151            error = true;
152            throw new SQLException(ioe.getLocalizedMessage(), ioe);
153        } catch (IllegalStateException ie) {
154            error = true;
155            throw new SQLException(ie.getLocalizedMessage(), ie);
156        } catch (RepositoryException e) {
157            error = true;
158            throw new SQLException(e.getLocalizedMessage(), e);
159        } finally {
160            try {
161                if (is != null) is.close();
162            } catch (Exception e) {
163                if (!error) throw new SQLException(e.getLocalizedMessage(), e);
164            }
165        }
166    }
167
168    protected final void notClosed() throws SQLException {
169        if (isClosed()) throw new SQLException(JdbcLocalI18n.resultSetIsClosed.text());
170    }
171
172    protected final void noUpdates() throws SQLException {
173        throw new SQLFeatureNotSupportedException(JdbcLocalI18n.updatesNotSupported.text());
174    }
175
176    protected final void forwardOnly() throws SQLException {
177        throw new SQLException(JdbcLocalI18n.resultSetIsForwardOnly.text());
178    }
179
180    protected final void itemNotFoundUsingColunName( String columnName ) throws SQLException {
181        throw new SQLException(JdbcLocalI18n.noSuchColumn.text(columnName));
182    }
183
184    @Override
185    public ResultSetMetaData getMetaData() throws SQLException {
186        notClosed();
187        return metadata;
188    }
189
190    @Override
191    public Statement getStatement() throws SQLException {
192        notClosed();
193        return statement;
194    }
195
196    /**
197     * {@inheritDoc}
198     * <p>
199     * This driver only supports {@link ResultSet#TYPE_FORWARD_ONLY}.
200     * </p>
201     * 
202     * @see java.sql.ResultSet#getType()
203     */
204    @Override
205    public int getType() throws SQLException {
206        notClosed();
207        return ResultSet.TYPE_FORWARD_ONLY;
208    }
209
210    /**
211     * {@inheritDoc}
212     * <p>
213     * This driver only supports {@link ResultSet#FETCH_FORWARD}.
214     * </p>
215     * 
216     * @see java.sql.ResultSet#getFetchDirection()
217     */
218    @Override
219    public int getFetchDirection() throws SQLException {
220        notClosed();
221        return ResultSet.FETCH_FORWARD;
222    }
223
224    /**
225     * {@inheritDoc}
226     * <p>
227     * This method, when called on an open result set, will have no effect on the fetch direction because this driver only
228     * supports {@link ResultSet#FETCH_FORWARD}.
229     * </p>
230     * 
231     * @see java.sql.ResultSet#setFetchDirection(int)
232     */
233    @Override
234    public void setFetchDirection( int direction ) throws SQLException {
235        throw new SQLFeatureNotSupportedException();
236    }
237
238    /**
239     * {@inheritDoc}
240     * <p>
241     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
242     * {@link ResultSet#FETCH_FORWARD}.
243     * </p>
244     * 
245     * @see java.sql.ResultSet#absolute(int)
246     */
247    @Override
248    public boolean absolute( int row ) throws SQLException {
249        notClosed();
250        forwardOnly();
251
252        return false;
253    }
254
255    /**
256     * {@inheritDoc}
257     * <p>
258     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
259     * {@link ResultSet#FETCH_FORWARD}.
260     * </p>
261     * 
262     * @see java.sql.ResultSet#afterLast()
263     */
264    @Override
265    public void afterLast() throws SQLException {
266        notClosed();
267        forwardOnly();
268    }
269
270    /**
271     * {@inheritDoc}
272     * <p>
273     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
274     * {@link ResultSet#FETCH_FORWARD}.
275     * </p>
276     * 
277     * @see java.sql.ResultSet#beforeFirst()
278     */
279    @Override
280    public void beforeFirst() throws SQLException {
281        notClosed();
282        forwardOnly();
283
284    }
285
286    @Override
287    public void cancelRowUpdates() throws SQLException {
288        notClosed();
289        noUpdates();
290    }
291
292    @Override
293    public void clearWarnings() throws SQLException {
294        notClosed();
295    }
296
297    @Override
298    public void deleteRow() throws SQLException {
299        notClosed();
300        noUpdates();
301    }
302
303    @Override
304    public int findColumn( String columnLabel ) throws SQLException {
305        notClosed();
306        final Integer result = columnLabel != null ? columnIndexesByName.get(columnLabel) : null;
307
308        if (result == null) {
309            this.itemNotFoundUsingColunName(columnLabel);
310        }
311        assert result != null;
312        return result;
313    }
314
315    private String findColumn( int columnIndex ) throws SQLException {
316        if (columnIndex > 0 && columnIndex < this.columnIDs.length) {
317            return columnIDs[columnIndex];
318        }
319
320        throw new SQLException(JdbcLocalI18n.invalidColumnIndex.text(new Object[] {columnIndex, this.columnIDs.length}));
321    }
322
323    /**
324     * {@inheritDoc}
325     * <p>
326     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
327     * {@link ResultSet#FETCH_FORWARD}.
328     * </p>
329     * 
330     * @see java.sql.ResultSet#first()
331     */
332    @Override
333    public boolean first() throws SQLException {
334        notClosed();
335        forwardOnly();
336
337        return false;
338    }
339
340    @Override
341    public int getRow() throws SQLException {
342        notClosed();
343        return (int)this.rowIter.getPosition();
344    }
345
346    @Override
347    public RowId getRowId( final int columnIndex ) throws SQLException {
348        throw new SQLFeatureNotSupportedException();
349    }
350
351    @Override
352    public RowId getRowId( String columnLabel ) throws SQLException {
353        throw new SQLFeatureNotSupportedException();
354    }
355
356    @Override
357    public String getCursorName() throws SQLException {
358        throw new SQLFeatureNotSupportedException();
359    }
360
361    @Override
362    public int getFetchSize() throws SQLException {
363        notClosed();
364        return statement.getFetchSize();
365    }
366
367    @Override
368    public Array getArray( int columnIndex ) throws SQLException {
369        throw new SQLFeatureNotSupportedException();
370    }
371
372    @Override
373    public Array getArray( String columnLabel ) throws SQLException {
374        throw new SQLFeatureNotSupportedException();
375    }
376
377    @Override
378    public InputStream getAsciiStream( int columnIndex ) throws SQLException {
379        throw new SQLFeatureNotSupportedException();
380    }
381
382    @Override
383    public InputStream getAsciiStream( String columnLabel ) throws SQLException {
384        throw new SQLFeatureNotSupportedException();
385    }
386
387    @Override
388    public BigDecimal getBigDecimal( int columnIndex ) throws SQLException {
389        return getBigDecimal(findColumn(columnIndex));
390    }
391
392    @Override
393    public BigDecimal getBigDecimal( String columnLabel ) throws SQLException {
394        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.DECIMAL);
395        if (o != null) {
396            return (BigDecimal)o;
397        }
398        return null;
399    }
400
401    @Override
402    @SuppressWarnings("deprecation")
403    public BigDecimal getBigDecimal( int columnIndex,
404                                     int scale ) throws SQLException {
405        return getBigDecimal(columnIndex).setScale(scale);
406    }
407
408    @Override
409    @SuppressWarnings("deprecation")
410    public BigDecimal getBigDecimal( String columnLabel,
411                                     int scale ) throws SQLException {
412        return getBigDecimal(columnLabel).setScale(scale);
413    }
414
415    @Override
416    public InputStream getBinaryStream( int columnIndex ) throws SQLException {
417        return getBinaryStream(findColumn(columnIndex));
418    }
419
420    @Override
421    public InputStream getBinaryStream( String columnLabel ) throws SQLException {
422        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.BINARY);
423        if (o != null) {
424            try {
425                return ((Binary) o).getStream();
426            } catch (RepositoryException e) {
427                throw new SQLException(e);
428            }
429        }
430        return null;
431    }
432
433    @Override
434    public Blob getBlob( int columnIndex ) throws SQLException {
435        return getBlob(findColumn(columnIndex));
436    }
437
438    @Override
439    public Blob getBlob( String columnLabel ) throws SQLException {
440        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.BINARY);
441        if (o != null) {
442            return new JcrBlob((Binary)o);
443        }
444        return null;
445    }
446
447    @Override
448    public boolean getBoolean( int columnIndex ) throws SQLException {
449        return getBoolean(findColumn(columnIndex));
450    }
451
452    @Override
453    public boolean getBoolean( String columnLabel ) throws SQLException {
454
455        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.BOOLEAN);
456        if (o != null) {
457            return (Boolean)o;
458        }
459        return false;
460    }
461
462    @Override
463    public byte getByte( int columnIndex ) throws SQLException {
464        return getByte(findColumn(columnIndex));
465    }
466
467    @Override
468    public byte getByte( String columnLabel ) throws SQLException {
469        return Long.valueOf(getLong(columnLabel)).byteValue();
470    }
471
472    @Override
473    public byte[] getBytes( int columnIndex ) throws SQLException {
474        return getBytes(findColumn(columnIndex));
475    }
476
477    @Override
478    public byte[] getBytes( String columnLabel ) throws SQLException {
479        notClosed();
480        isRowSet();
481
482        this.currentValue = null;
483        try {
484            Value value = row.getValue(columnLabel);
485            byte[] rtnbytes = convertToByteArray(value);
486            this.currentValue = rtnbytes;
487            return rtnbytes;
488        } catch (PathNotFoundException pnfe) {
489            // do nothing, return null
490        } catch (ItemNotFoundException e) {
491            itemNotFoundUsingColunName(columnLabel);
492        } catch (RepositoryException e) {
493            throw new SQLException(e.getLocalizedMessage(), e);
494        }
495        return null;
496    }
497
498    @Override
499    public Reader getCharacterStream( int columnIndex ) throws SQLException {
500        throw new SQLFeatureNotSupportedException();
501    }
502
503    @Override
504    public Reader getCharacterStream( String columnLabel ) throws SQLException {
505        throw new SQLFeatureNotSupportedException();
506    }
507
508    @Override
509    public Clob getClob( int columnIndex ) throws SQLException {
510        throw new SQLFeatureNotSupportedException();
511    }
512
513    @Override
514    public Clob getClob( String columnLabel ) throws SQLException {
515        throw new SQLFeatureNotSupportedException();
516    }
517
518    @Override
519    public int getConcurrency() throws SQLException {
520        notClosed();
521        return 0;
522    }
523
524    @Override
525    public Date getDate( int columnIndex ) throws SQLException {
526        return getDate(findColumn(columnIndex));
527    }
528
529    @Override
530    public Date getDate( String columnLabel ) throws SQLException {
531        Calendar calv = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
532        if (calv == null) return null;
533
534        return TimestampWithTimezone.createDate(calv);
535    }
536
537    @Override
538    public Date getDate( int columnIndex,
539                         Calendar cal ) throws SQLException {
540        return getDate(findColumn(columnIndex), cal);
541    }
542
543    @Override
544    public Date getDate( String columnLabel,
545                         Calendar cal ) throws SQLException {
546
547        Calendar actual = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
548
549        if (actual == null) return null;
550
551        return TimestampWithTimezone.createDate(actual, cal);
552
553    }
554
555    @Override
556    public double getDouble( int columnIndex ) throws SQLException {
557        return getDouble(findColumn(columnIndex));
558    }
559
560    @Override
561    public double getDouble( String columnLabel ) throws SQLException {
562        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.DOUBLE);
563        if (o != null) {
564            return (Double)o;
565        }
566        return 0;
567    }
568
569    @Override
570    public float getFloat( int columnIndex ) throws SQLException {
571        return getFloat(findColumn(columnIndex));
572    }
573
574    @Override
575    public float getFloat( String columnLabel ) throws SQLException {
576        return Double.valueOf(getDouble(columnLabel)).floatValue();
577    }
578
579    /**
580     * {@inheritDoc}
581     * <p>
582     * According to 1.6 javadocs, holdability should be set to either {@link ResultSet#CLOSE_CURSORS_AT_COMMIT} or
583     * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT}. However, JDBC 4.0 spec says the default holdability is implementation defined.
584     * Therefore, the default value will be 0.
585     * 
586     * @see java.sql.ResultSet#getHoldability()
587     */
588    @Override
589    public int getHoldability() throws SQLException {
590        notClosed();
591        return 0;
592    }
593
594    @Override
595    public int getInt( int columnIndex ) throws SQLException {
596        return getInt(findColumn(columnIndex));
597    }
598
599    @Override
600    public int getInt( String columnLabel ) throws SQLException {
601        notClosed();
602        return (int)getLong(columnLabel);
603    }
604
605    @Override
606    public long getLong( int columnIndex ) throws SQLException {
607        return getLong(findColumn(columnIndex));
608    }
609
610    @Override
611    public long getLong( String columnLabel ) throws SQLException {
612        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.LONG);
613        if (o != null) {
614            return (Long)o;
615        }
616        return 0L;
617    }
618
619    @Override
620    public Reader getNCharacterStream( int columnIndex ) throws SQLException {
621        throw new SQLFeatureNotSupportedException();
622    }
623
624    @Override
625    public Reader getNCharacterStream( String columnLabel ) throws SQLException {
626        throw new SQLFeatureNotSupportedException();
627    }
628
629    @Override
630    public NClob getNClob( int columnIndex ) throws SQLException {
631        throw new SQLFeatureNotSupportedException();
632    }
633
634    @Override
635    public NClob getNClob( String columnLabel ) throws SQLException {
636        throw new SQLFeatureNotSupportedException();
637    }
638
639    @Override
640    public String getNString( int columnIndex ) throws SQLException {
641        throw new SQLFeatureNotSupportedException();
642    }
643
644    @Override
645    public String getNString( String columnLabel ) throws SQLException {
646        throw new SQLFeatureNotSupportedException();
647    }
648
649    @Override
650    public Object getObject( int columnIndex ) throws SQLException {
651        return getObject(findColumn(columnIndex));
652    }
653
654    @Override
655    public Object getObject( String columnLabel ) throws SQLException {
656        return getColumnTranslatedToJDBC(columnLabel);
657    }
658
659    @Override
660    public Object getObject( int columnIndex,
661                             Map<String, Class<?>> map ) throws SQLException {
662        throw new SQLFeatureNotSupportedException();
663    }
664
665    @Override
666    public Object getObject( String columnLabel,
667                             Map<String, Class<?>> map ) throws SQLException {
668        throw new SQLFeatureNotSupportedException();
669
670    }
671
672    /**
673     * This method always throws {@link SQLFeatureNotSupportedException}.
674     * <p>
675     * <em>Note:</em> This method is part of the JDBC API in JDK 1.7.
676     * </p>
677     * 
678     * @param columnIndex
679     * @param type
680     * @param <T> the type class
681     * @return the object
682     * @throws SQLException
683     */
684    @Override
685    public <T> T getObject( int columnIndex,
686                            Class<T> type ) throws SQLException {
687        throw new SQLFeatureNotSupportedException();
688    }
689
690    /**
691     * This method always throws {@link SQLFeatureNotSupportedException}.
692     * <p>
693     * <em>Note:</em> This method is part of the JDBC API in JDK 1.7.
694     * </p>
695     * 
696     * @param columnLabel
697     * @param type
698     * @param <T> the type class
699     * @return the object
700     * @throws SQLException
701     */
702    @Override
703    public <T> T getObject( String columnLabel,
704                            Class<T> type ) throws SQLException {
705        throw new SQLFeatureNotSupportedException();
706    }
707
708    @Override
709    public Ref getRef( int columnIndex ) throws SQLException {
710        throw new SQLFeatureNotSupportedException();
711    }
712
713    @Override
714    public Ref getRef( String columnLabel ) throws SQLException {
715        throw new SQLFeatureNotSupportedException();
716    }
717
718    @Override
719    public SQLXML getSQLXML( int columnIndex ) throws SQLException {
720        throw new SQLFeatureNotSupportedException();
721    }
722
723    @Override
724    public SQLXML getSQLXML( String columnLabel ) throws SQLException {
725        throw new SQLFeatureNotSupportedException();
726    }
727
728    @Override
729    public short getShort( int columnIndex ) throws SQLException {
730        return getShort(findColumn(columnIndex));
731    }
732
733    @Override
734    public short getShort( String columnLabel ) throws SQLException {
735        return Long.valueOf(getLong(columnLabel)).shortValue();
736    }
737
738    @Override
739    public String getString( int columnIndex ) throws SQLException {
740        return getString(findColumn(columnIndex));
741    }
742
743    @Override
744    public String getString( String columnLabel ) throws SQLException {
745        Object o = updateCurrentValueFromColumn(columnLabel, PropertyType.STRING);
746        if (o != null) {
747            return (String)o;
748        }
749        return null;
750    }
751
752    @Override
753    public Time getTime( int columnIndex ) throws SQLException {
754        return getTime(findColumn(columnIndex));
755    }
756
757    @Override
758    public Time getTime( String columnLabel ) throws SQLException {
759        Calendar calv = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
760        if (calv == null) return null;
761
762        return TimestampWithTimezone.createTime(calv);
763    }
764
765    @Override
766    public Time getTime( int columnIndex,
767                         Calendar cal ) throws SQLException {
768        return getTime(findColumn(columnIndex), cal);
769    }
770
771    @Override
772    public Time getTime( String columnLabel,
773                         Calendar cal ) throws SQLException {
774
775        Calendar actual = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
776
777        if (actual == null) return null;
778
779        // if cal is null, it will be supplied in TimestampWithTimezone
780        return TimestampWithTimezone.createTime(actual, cal);
781
782    }
783
784    @Override
785    public Timestamp getTimestamp( int columnIndex ) throws SQLException {
786        return getTimestamp(findColumn(columnIndex));
787    }
788
789    @Override
790    public Timestamp getTimestamp( String columnLabel ) throws SQLException {
791        Calendar calv = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
792        if (calv == null) return null;
793        return TimestampWithTimezone.createTimestamp(calv);
794
795    }
796
797    @Override
798    public Timestamp getTimestamp( int columnIndex,
799                                   Calendar cal ) throws SQLException {
800        return getTimestamp(findColumn(columnIndex), cal);
801    }
802
803    @Override
804    public Timestamp getTimestamp( String columnLabel,
805                                   Calendar cal ) throws SQLException {
806
807        Calendar actual = (Calendar)updateCurrentValueFromColumn(columnLabel, PropertyType.DATE);
808        if (actual == null) return null;
809        // if cal is null, it will be supplied in TimestampWithTimezone
810        return TimestampWithTimezone.createTimestamp(actual, cal);
811    }
812
813    @Override
814    public URL getURL( int columnIndex ) throws SQLException {
815        return getURL(findColumn(columnIndex));
816    }
817
818    @Override
819    public URL getURL( String columnLabel ) throws SQLException {
820        try {
821            return new URL(getString(columnLabel));
822        } catch (MalformedURLException e) {
823            throw new SQLException(e);
824        }
825    }
826
827    @Override
828    @SuppressWarnings("deprecation")
829    public InputStream getUnicodeStream( int columnIndex ) throws SQLException {
830        throw new SQLFeatureNotSupportedException();
831    }
832
833    @Override
834    @SuppressWarnings("deprecation")
835    public InputStream getUnicodeStream( String columnLabel ) throws SQLException {
836        throw new SQLFeatureNotSupportedException();
837    }
838
839    public Value getValue( int columnIndex ) throws SQLException {
840        return getValue(findColumn(columnIndex));
841
842    }
843
844    public Value getValue( String columnLabel ) throws SQLException {
845        notClosed();
846        isRowSet();
847
848        try {
849            return row.getValue(columnLabel);
850        } catch (PathNotFoundException pnfe) {
851            return null;
852        } catch (RepositoryException e) {
853            throw new SQLException(e.getLocalizedMessage(), e);
854        }
855
856    }
857
858    private Object updateCurrentValueFromColumn( String columnName,
859                                                 int asType ) throws SQLException {
860        notClosed();
861        isRowSet();
862
863        this.currentValue = null;
864        try {
865            final Value jcrValue = row.getValue(columnName);
866            this.currentValue = extractValue(jcrValue, asType);
867        } catch (PathNotFoundException pnfe) {
868            // do nothing
869        } catch (ItemNotFoundException e) {
870            itemNotFoundUsingColunName(columnName);
871        } catch (RepositoryException e) {
872            throw new SQLException(e.getLocalizedMessage(), e);
873        }
874        return this.currentValue;
875    }
876
877    private Object extractValue( Value jcrValue,
878                                 int asType ) throws SQLException {
879        if (jcrValue == null) {
880            return null;
881        }
882
883        try {
884            switch (asType) {
885                case PropertyType.STRING: {
886                    return jcrValue.getString();
887                }
888                case PropertyType.BOOLEAN: {
889                    return jcrValue.getBoolean();
890                }
891                case PropertyType.DATE: {
892                    return jcrValue.getDate();
893                }
894                case PropertyType.DOUBLE: {
895                    return jcrValue.getDouble();
896                }
897                case PropertyType.LONG: {
898                    return jcrValue.getLong();
899                }
900                case PropertyType.DECIMAL:  {
901                    return jcrValue.getDecimal();
902                }
903                case PropertyType.BINARY: {
904                    if (jcrValue.getType() != PropertyType.BINARY) {
905                        throw new SQLException(JdbcLocalI18n.cannotConvertJcrValue.text(PropertyType.nameFromValue(jcrValue.getType()),
906                                                                                        PropertyType.TYPENAME_BINARY));
907                    }
908                    return jcrValue.getBinary();
909                }
910                default: {
911                    return jcrValue.getString();
912                }
913            }
914        } catch (ValueFormatException ve) {
915            throw new SQLException(JdbcLocalI18n.cannotConvertJcrValue.text(PropertyType.nameFromValue(jcrValue.getType()),
916                                                                            PropertyType.nameFromValue(asType)), ve);
917        } catch (IllegalArgumentException ie) {
918            throw new SQLException(JdbcLocalI18n.cannotConvertJcrValue.text(PropertyType.nameFromValue(jcrValue.getType()),
919                                                                            PropertyType.nameFromValue(asType)), ie);
920        } catch (RepositoryException e) {
921            throw new SQLException(e);
922        }
923    }
924
925    /**
926     * This method transforms a {@link Value} into a JDBC type based on {@link JcrType} mappings
927     * 
928     * @param columnName
929     * @return Object
930     * @throws SQLException
931     */
932    private Object getColumnTranslatedToJDBC( String columnName ) throws SQLException {
933        notClosed();
934        isRowSet();
935
936        Value value = null;
937        this.currentValue = null;
938
939        try {
940            value = row.getValue(columnName);
941        } catch (javax.jcr.PathNotFoundException pnf) {
942            // do nothing
943        } catch (RepositoryException e) {
944            throw new SQLException(e.getLocalizedMessage(), e);
945        }
946
947        if (value == null) return null;
948
949        this.currentValue = JcrType.translateValueToJDBC(value);
950        return this.currentValue;
951    }
952
953    @Override
954    public SQLWarning getWarnings() /*throws SQLException*/{
955        return null;
956    }
957
958    protected boolean hasNext() {
959        return rowIter.hasNext();
960    }
961
962    @Override
963    public void insertRow() throws SQLException {
964        this.notClosed();
965        this.noUpdates();
966    }
967
968    @Override
969    public boolean isAfterLast() throws SQLException {
970        this.notClosed();
971        if (this.row == null && !this.rowIter.hasNext() && this.rowIter.getPosition() == this.rowIter.getSize()) {
972            return true;
973        }
974        return false;
975
976    }
977
978    @Override
979    public boolean isBeforeFirst() throws SQLException {
980        this.notClosed();
981        if (this.rowIter.getPosition() == 0) {
982            return true;
983        }
984        return false;
985    }
986
987    @Override
988    public boolean isFirst() throws SQLException {
989        this.notClosed();
990        if (this.rowIter.getPosition() == 1) {
991            return true;
992        }
993        return false;
994    }
995
996    @Override
997    public boolean isLast() throws SQLException {
998        this.notClosed();
999
1000        if (this.row != null && !this.rowIter.hasNext() && this.rowIter.getPosition() == this.rowIter.getSize()) {
1001            return true;
1002        }
1003        return false;
1004    }
1005
1006    protected final void isRowSet() throws SQLException {
1007        if (this.row != null) return;
1008
1009        throw new SQLException(JdbcLocalI18n.currentRowNotSet.text());
1010    }
1011
1012    /**
1013     * {@inheritDoc}
1014     * <p>
1015     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
1016     * {@link ResultSet#FETCH_FORWARD}.
1017     * </p>
1018     * 
1019     * @see java.sql.ResultSet#last()
1020     */
1021    @Override
1022    public boolean last() throws SQLException {
1023        notClosed();
1024        forwardOnly();
1025        return false;
1026    }
1027
1028    /**
1029     * {@inheritDoc}
1030     * <p>
1031     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
1032     * {@link ResultSet#FETCH_FORWARD}.
1033     * </p>
1034     * 
1035     * @see java.sql.ResultSet#moveToCurrentRow()
1036     */
1037    @Override
1038    public void moveToCurrentRow() throws SQLException {
1039        notClosed();
1040        forwardOnly();
1041    }
1042
1043    @Override
1044    public void moveToInsertRow() throws SQLException {
1045        this.noUpdates();
1046    }
1047
1048    /**
1049     * {@inheritDoc}
1050     * <p>
1051     * This method, when cursor position is after the last row, will return <code>false</code>
1052     * </p>
1053     * 
1054     * @see java.sql.ResultSet#next()
1055     */
1056    @Override
1057    public boolean next() throws SQLException {
1058        notClosed();
1059        if (!this.hasNext()) {
1060            this.row = null;
1061            this.currentValue = null;
1062            return false;
1063        }
1064
1065        this.row = rowIter.nextRow();
1066        return true;
1067    }
1068
1069    /**
1070     * {@inheritDoc}
1071     * <p>
1072     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
1073     * {@link ResultSet#FETCH_FORWARD}.
1074     * </p>
1075     * 
1076     * @see java.sql.ResultSet#previous()
1077     */
1078    @Override
1079    public boolean previous() throws SQLException {
1080        notClosed();
1081        this.forwardOnly();
1082        return false;
1083    }
1084
1085    /**
1086     * {@inheritDoc}
1087     * <p>
1088     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
1089     * {@link ResultSet#FETCH_FORWARD}.
1090     * </p>
1091     * 
1092     * @see java.sql.ResultSet#refreshRow()
1093     */
1094    @Override
1095    public void refreshRow() throws SQLException {
1096        notClosed();
1097        this.forwardOnly();
1098    }
1099
1100    /**
1101     * {@inheritDoc}
1102     * <p>
1103     * This method, when called on an open result set, always throws {@link SQLException} because this driver only supports
1104     * {@link ResultSet#FETCH_FORWARD}.
1105     * </p>
1106     * 
1107     * @see java.sql.ResultSet#relative(int)
1108     */
1109    @Override
1110    public boolean relative( int rows ) throws SQLException {
1111        throw new SQLFeatureNotSupportedException();
1112    }
1113
1114    /**
1115     * {@inheritDoc}
1116     * <p>
1117     * This method always returns false since this JDBC driver does not support any updates.
1118     * </p>
1119     * 
1120     * @see java.sql.ResultSet#rowDeleted()
1121     */
1122    @Override
1123    public boolean rowDeleted() throws SQLException {
1124        throw new SQLFeatureNotSupportedException();
1125    }
1126
1127    /**
1128     * {@inheritDoc}
1129     * <p>
1130     * This method always returns false since this JDBC driver does not support any updates.
1131     * </p>
1132     * 
1133     * @see java.sql.ResultSet#rowInserted()
1134     */
1135    @Override
1136    public boolean rowInserted() throws SQLException {
1137        throw new SQLFeatureNotSupportedException();
1138    }
1139
1140    /**
1141     * {@inheritDoc}
1142     * <p>
1143     * This method always returns false since this JDBC driver does not support any updates.
1144     * </p>
1145     * 
1146     * @see java.sql.ResultSet#rowUpdated()
1147     */
1148    @Override
1149    public boolean rowUpdated() throws SQLException {
1150        throw new SQLFeatureNotSupportedException();
1151    }
1152
1153    @Override
1154    public void setFetchSize( int rows ) /*throws SQLException*/{
1155        // does nothing
1156    }
1157
1158    /**
1159     * {@inheritDoc}
1160     * <p>
1161     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1162     * driver does not support any updates.
1163     * </p>
1164     * 
1165     * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
1166     */
1167    @Override
1168    public void updateArray( int columnIndex,
1169                             Array x ) throws SQLException {
1170        notClosed();
1171        noUpdates();
1172    }
1173
1174    /**
1175     * {@inheritDoc}
1176     * <p>
1177     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1178     * driver does not support any updates.
1179     * </p>
1180     * 
1181     * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
1182     */
1183    @Override
1184    public void updateArray( String columnLabel,
1185                             Array x ) throws SQLException {
1186        notClosed();
1187        noUpdates();
1188    }
1189
1190    /**
1191     * {@inheritDoc}
1192     * <p>
1193     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1194     * driver does not support any updates.
1195     * </p>
1196     * 
1197     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream)
1198     */
1199    @Override
1200    public void updateAsciiStream( int columnIndex,
1201                                   InputStream x ) throws SQLException {
1202        notClosed();
1203        noUpdates();
1204    }
1205
1206    /**
1207     * {@inheritDoc}
1208     * <p>
1209     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1210     * driver does not support any updates.
1211     * </p>
1212     * 
1213     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream)
1214     */
1215    @Override
1216    public void updateAsciiStream( String columnLabel,
1217                                   InputStream x ) throws SQLException {
1218        notClosed();
1219        noUpdates();
1220    }
1221
1222    /**
1223     * {@inheritDoc}
1224     * <p>
1225     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1226     * driver does not support any updates.
1227     * </p>
1228     * 
1229     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
1230     */
1231    @Override
1232    public void updateAsciiStream( int columnIndex,
1233                                   InputStream x,
1234                                   int length ) throws SQLException {
1235        notClosed();
1236        noUpdates();
1237    }
1238
1239    /**
1240     * {@inheritDoc}
1241     * <p>
1242     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1243     * driver does not support any updates.
1244     * </p>
1245     * 
1246     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
1247     */
1248    @Override
1249    public void updateAsciiStream( String columnLabel,
1250                                   InputStream x,
1251                                   int length ) throws SQLException {
1252        notClosed();
1253        noUpdates();
1254    }
1255
1256    /**
1257     * {@inheritDoc}
1258     * <p>
1259     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1260     * driver does not support any updates.
1261     * </p>
1262     * 
1263     * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, long)
1264     */
1265    @Override
1266    public void updateAsciiStream( int columnIndex,
1267                                   InputStream x,
1268                                   long length ) throws SQLException {
1269        notClosed();
1270        noUpdates();
1271    }
1272
1273    /**
1274     * {@inheritDoc}
1275     * <p>
1276     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1277     * driver does not support any updates.
1278     * </p>
1279     * 
1280     * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, long)
1281     */
1282    @Override
1283    public void updateAsciiStream( String columnLabel,
1284                                   InputStream x,
1285                                   long length ) throws SQLException {
1286        notClosed();
1287        noUpdates();
1288    }
1289
1290    /**
1291     * {@inheritDoc}
1292     * <p>
1293     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1294     * driver does not support any updates.
1295     * </p>
1296     * 
1297     * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
1298     */
1299    @Override
1300    public void updateBigDecimal( int columnIndex,
1301                                  BigDecimal x ) throws SQLException {
1302        notClosed();
1303        noUpdates();
1304    }
1305
1306    /**
1307     * {@inheritDoc}
1308     * <p>
1309     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1310     * driver does not support any updates.
1311     * </p>
1312     * 
1313     * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
1314     */
1315    @Override
1316    public void updateBigDecimal( String columnLabel,
1317                                  BigDecimal x ) throws SQLException {
1318        notClosed();
1319        noUpdates();
1320    }
1321
1322    /**
1323     * {@inheritDoc}
1324     * <p>
1325     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1326     * driver does not support any updates.
1327     * </p>
1328     * 
1329     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream)
1330     */
1331    @Override
1332    public void updateBinaryStream( int columnIndex,
1333                                    InputStream x ) throws SQLException {
1334        notClosed();
1335        noUpdates();
1336    }
1337
1338    /**
1339     * {@inheritDoc}
1340     * <p>
1341     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1342     * driver does not support any updates.
1343     * </p>
1344     * 
1345     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream)
1346     */
1347    @Override
1348    public void updateBinaryStream( String columnLabel,
1349                                    InputStream x ) throws SQLException {
1350        notClosed();
1351        noUpdates();
1352    }
1353
1354    /**
1355     * {@inheritDoc}
1356     * <p>
1357     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1358     * driver does not support any updates.
1359     * </p>
1360     * 
1361     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
1362     */
1363    @Override
1364    public void updateBinaryStream( int columnIndex,
1365                                    InputStream x,
1366                                    int length ) throws SQLException {
1367        notClosed();
1368        noUpdates();
1369    }
1370
1371    /**
1372     * {@inheritDoc}
1373     * <p>
1374     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1375     * driver does not support any updates.
1376     * </p>
1377     * 
1378     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
1379     */
1380    @Override
1381    public void updateBinaryStream( String columnLabel,
1382                                    InputStream x,
1383                                    int length ) throws SQLException {
1384        notClosed();
1385        noUpdates();
1386    }
1387
1388    /**
1389     * {@inheritDoc}
1390     * <p>
1391     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1392     * driver does not support any updates.
1393     * </p>
1394     * 
1395     * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, long)
1396     */
1397    @Override
1398    public void updateBinaryStream( int columnIndex,
1399                                    InputStream x,
1400                                    long length ) throws SQLException {
1401        notClosed();
1402        noUpdates();
1403    }
1404
1405    /**
1406     * {@inheritDoc}
1407     * <p>
1408     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1409     * driver does not support any updates.
1410     * </p>
1411     * 
1412     * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, long)
1413     */
1414    @Override
1415    public void updateBinaryStream( String columnLabel,
1416                                    InputStream x,
1417                                    long length ) throws SQLException {
1418        notClosed();
1419        noUpdates();
1420    }
1421
1422    /**
1423     * {@inheritDoc}
1424     * <p>
1425     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1426     * driver does not support any updates.
1427     * </p>
1428     * 
1429     * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
1430     */
1431    @Override
1432    public void updateBlob( int columnIndex,
1433                            Blob x ) throws SQLException {
1434        notClosed();
1435        noUpdates();
1436    }
1437
1438    /**
1439     * {@inheritDoc}
1440     * <p>
1441     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1442     * driver does not support any updates.
1443     * </p>
1444     * 
1445     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
1446     */
1447    @Override
1448    public void updateBlob( String columnLabel,
1449                            Blob x ) throws SQLException {
1450        notClosed();
1451        noUpdates();
1452    }
1453
1454    /**
1455     * {@inheritDoc}
1456     * <p>
1457     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1458     * driver does not support any updates.
1459     * </p>
1460     * 
1461     * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream)
1462     */
1463    @Override
1464    public void updateBlob( int columnIndex,
1465                            InputStream inputStream ) throws SQLException {
1466        notClosed();
1467        noUpdates();
1468    }
1469
1470    /**
1471     * {@inheritDoc}
1472     * <p>
1473     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1474     * driver does not support any updates.
1475     * </p>
1476     * 
1477     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream)
1478     */
1479    @Override
1480    public void updateBlob( String columnLabel,
1481                            InputStream inputStream ) throws SQLException {
1482        notClosed();
1483        noUpdates();
1484    }
1485
1486    /**
1487     * {@inheritDoc}
1488     * <p>
1489     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1490     * driver does not support any updates.
1491     * </p>
1492     * 
1493     * @see java.sql.ResultSet#updateBlob(int, java.io.InputStream, long)
1494     */
1495    @Override
1496    public void updateBlob( int columnIndex,
1497                            InputStream inputStream,
1498                            long length ) throws SQLException {
1499        notClosed();
1500        noUpdates();
1501    }
1502
1503    /**
1504     * {@inheritDoc}
1505     * <p>
1506     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1507     * driver does not support any updates.
1508     * </p>
1509     * 
1510     * @see java.sql.ResultSet#updateBlob(java.lang.String, java.io.InputStream, long)
1511     */
1512    @Override
1513    public void updateBlob( String columnLabel,
1514                            InputStream inputStream,
1515                            long length ) throws SQLException {
1516        notClosed();
1517        noUpdates();
1518    }
1519
1520    /**
1521     * {@inheritDoc}
1522     * <p>
1523     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1524     * driver does not support any updates.
1525     * </p>
1526     * 
1527     * @see java.sql.ResultSet#updateBoolean(int, boolean)
1528     */
1529    @Override
1530    public void updateBoolean( int columnIndex,
1531                               boolean x ) throws SQLException {
1532        notClosed();
1533        noUpdates();
1534    }
1535
1536    /**
1537     * {@inheritDoc}
1538     * <p>
1539     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1540     * driver does not support any updates.
1541     * </p>
1542     * 
1543     * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
1544     */
1545    @Override
1546    public void updateBoolean( String columnLabel,
1547                               boolean x ) throws SQLException {
1548        notClosed();
1549        noUpdates();
1550    }
1551
1552    /**
1553     * {@inheritDoc}
1554     * <p>
1555     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1556     * driver does not support any updates.
1557     * </p>
1558     * 
1559     * @see java.sql.ResultSet#updateByte(int, byte)
1560     */
1561    @Override
1562    public void updateByte( int columnIndex,
1563                            byte x ) throws SQLException {
1564        notClosed();
1565        noUpdates();
1566    }
1567
1568    /**
1569     * {@inheritDoc}
1570     * <p>
1571     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1572     * driver does not support any updates.
1573     * </p>
1574     * 
1575     * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
1576     */
1577    @Override
1578    public void updateByte( String columnLabel,
1579                            byte x ) throws SQLException {
1580        notClosed();
1581        noUpdates();
1582    }
1583
1584    /**
1585     * {@inheritDoc}
1586     * <p>
1587     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1588     * driver does not support any updates.
1589     * </p>
1590     * 
1591     * @see java.sql.ResultSet#updateBytes(int, byte[])
1592     */
1593    @Override
1594    public void updateBytes( int columnIndex,
1595                             byte[] x ) throws SQLException {
1596        notClosed();
1597        noUpdates();
1598    }
1599
1600    /**
1601     * {@inheritDoc}
1602     * <p>
1603     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1604     * driver does not support any updates.
1605     * </p>
1606     * 
1607     * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
1608     */
1609    @Override
1610    public void updateBytes( String columnLabel,
1611                             byte[] x ) throws SQLException {
1612        notClosed();
1613        noUpdates();
1614    }
1615
1616    /**
1617     * {@inheritDoc}
1618     * <p>
1619     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1620     * driver does not support any updates.
1621     * </p>
1622     * 
1623     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader)
1624     */
1625    @Override
1626    public void updateCharacterStream( int columnIndex,
1627                                       Reader x ) throws SQLException {
1628        notClosed();
1629        noUpdates();
1630    }
1631
1632    /**
1633     * {@inheritDoc}
1634     * <p>
1635     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1636     * driver does not support any updates.
1637     * </p>
1638     * 
1639     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader)
1640     */
1641    @Override
1642    public void updateCharacterStream( String columnLabel,
1643                                       Reader reader ) throws SQLException {
1644        notClosed();
1645        noUpdates();
1646    }
1647
1648    /**
1649     * {@inheritDoc}
1650     * <p>
1651     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1652     * driver does not support any updates.
1653     * </p>
1654     * 
1655     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
1656     */
1657    @Override
1658    public void updateCharacterStream( int columnIndex,
1659                                       Reader x,
1660                                       int length ) throws SQLException {
1661        notClosed();
1662        noUpdates();
1663    }
1664
1665    /**
1666     * {@inheritDoc}
1667     * <p>
1668     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1669     * driver does not support any updates.
1670     * </p>
1671     * 
1672     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
1673     */
1674    @Override
1675    public void updateCharacterStream( String columnLabel,
1676                                       Reader reader,
1677                                       int length ) throws SQLException {
1678        notClosed();
1679        noUpdates();
1680    }
1681
1682    /**
1683     * {@inheritDoc}
1684     * <p>
1685     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1686     * driver does not support any updates.
1687     * </p>
1688     * 
1689     * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, long)
1690     */
1691    @Override
1692    public void updateCharacterStream( int columnIndex,
1693                                       Reader x,
1694                                       long length ) throws SQLException {
1695        notClosed();
1696        noUpdates();
1697    }
1698
1699    /**
1700     * {@inheritDoc}
1701     * <p>
1702     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1703     * driver does not support any updates.
1704     * </p>
1705     * 
1706     * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, long)
1707     */
1708    @Override
1709    public void updateCharacterStream( String columnLabel,
1710                                       Reader reader,
1711                                       long length ) throws SQLException {
1712        notClosed();
1713        noUpdates();
1714    }
1715
1716    /**
1717     * {@inheritDoc}
1718     * <p>
1719     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1720     * driver does not support any updates.
1721     * </p>
1722     * 
1723     * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
1724     */
1725    @Override
1726    public void updateClob( int columnIndex,
1727                            Clob x ) throws SQLException {
1728        notClosed();
1729        noUpdates();
1730    }
1731
1732    /**
1733     * {@inheritDoc}
1734     * <p>
1735     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1736     * driver does not support any updates.
1737     * </p>
1738     * 
1739     * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
1740     */
1741    @Override
1742    public void updateClob( String columnLabel,
1743                            Clob x ) throws SQLException {
1744        notClosed();
1745        noUpdates();
1746    }
1747
1748    /**
1749     * {@inheritDoc}
1750     * <p>
1751     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1752     * driver does not support any updates.
1753     * </p>
1754     * 
1755     * @see java.sql.ResultSet#updateClob(int, java.io.Reader)
1756     */
1757    @Override
1758    public void updateClob( int columnIndex,
1759                            Reader reader ) throws SQLException {
1760        notClosed();
1761        noUpdates();
1762    }
1763
1764    /**
1765     * {@inheritDoc}
1766     * <p>
1767     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1768     * driver does not support any updates.
1769     * </p>
1770     * 
1771     * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader)
1772     */
1773    @Override
1774    public void updateClob( String columnLabel,
1775                            Reader reader ) throws SQLException {
1776        notClosed();
1777        noUpdates();
1778    }
1779
1780    /**
1781     * {@inheritDoc}
1782     * <p>
1783     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1784     * driver does not support any updates.
1785     * </p>
1786     * 
1787     * @see java.sql.ResultSet#updateClob(int, java.io.Reader, long)
1788     */
1789    @Override
1790    public void updateClob( int columnIndex,
1791                            Reader reader,
1792                            long length ) throws SQLException {
1793        notClosed();
1794        noUpdates();
1795    }
1796
1797    /**
1798     * {@inheritDoc}
1799     * <p>
1800     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1801     * driver does not support any updates.
1802     * </p>
1803     * 
1804     * @see java.sql.ResultSet#updateClob(java.lang.String, java.io.Reader, long)
1805     */
1806    @Override
1807    public void updateClob( String columnLabel,
1808                            Reader reader,
1809                            long length ) throws SQLException {
1810        notClosed();
1811        noUpdates();
1812    }
1813
1814    /**
1815     * {@inheritDoc}
1816     * <p>
1817     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1818     * driver does not support any updates.
1819     * </p>
1820     * 
1821     * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
1822     */
1823    @Override
1824    public void updateDate( int columnIndex,
1825                            Date x ) throws SQLException {
1826        notClosed();
1827        noUpdates();
1828    }
1829
1830    /**
1831     * {@inheritDoc}
1832     * <p>
1833     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1834     * driver does not support any updates.
1835     * </p>
1836     * 
1837     * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
1838     */
1839    @Override
1840    public void updateDate( String columnLabel,
1841                            Date x ) throws SQLException {
1842        notClosed();
1843        noUpdates();
1844    }
1845
1846    /**
1847     * {@inheritDoc}
1848     * <p>
1849     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1850     * driver does not support any updates.
1851     * </p>
1852     * 
1853     * @see java.sql.ResultSet#updateDouble(int, double)
1854     */
1855    @Override
1856    public void updateDouble( int columnIndex,
1857                              double x ) throws SQLException {
1858        notClosed();
1859        noUpdates();
1860    }
1861
1862    /**
1863     * {@inheritDoc}
1864     * <p>
1865     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1866     * driver does not support any updates.
1867     * </p>
1868     * 
1869     * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
1870     */
1871    @Override
1872    public void updateDouble( String columnLabel,
1873                              double x ) throws SQLException {
1874        notClosed();
1875        noUpdates();
1876    }
1877
1878    /**
1879     * {@inheritDoc}
1880     * <p>
1881     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1882     * driver does not support any updates.
1883     * </p>
1884     * 
1885     * @see java.sql.ResultSet#updateFloat(int, float)
1886     */
1887    @Override
1888    public void updateFloat( int columnIndex,
1889                             float x ) throws SQLException {
1890        notClosed();
1891        noUpdates();
1892    }
1893
1894    /**
1895     * {@inheritDoc}
1896     * <p>
1897     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1898     * driver does not support any updates.
1899     * </p>
1900     * 
1901     * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
1902     */
1903    @Override
1904    public void updateFloat( String columnLabel,
1905                             float x ) throws SQLException {
1906        notClosed();
1907        noUpdates();
1908    }
1909
1910    /**
1911     * {@inheritDoc}
1912     * <p>
1913     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1914     * driver does not support any updates.
1915     * </p>
1916     * 
1917     * @see java.sql.ResultSet#updateInt(int, int)
1918     */
1919    @Override
1920    public void updateInt( int columnIndex,
1921                           int x ) throws SQLException {
1922        notClosed();
1923        noUpdates();
1924    }
1925
1926    /**
1927     * {@inheritDoc}
1928     * <p>
1929     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1930     * driver does not support any updates.
1931     * </p>
1932     * 
1933     * @see java.sql.ResultSet#updateInt(java.lang.String, int)
1934     */
1935    @Override
1936    public void updateInt( String columnLabel,
1937                           int x ) throws SQLException {
1938        notClosed();
1939        noUpdates();
1940    }
1941
1942    /**
1943     * {@inheritDoc}
1944     * <p>
1945     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1946     * driver does not support any updates.
1947     * </p>
1948     * 
1949     * @see java.sql.ResultSet#updateLong(int, long)
1950     */
1951    @Override
1952    public void updateLong( int columnIndex,
1953                            long x ) throws SQLException {
1954        notClosed();
1955        noUpdates();
1956    }
1957
1958    /**
1959     * {@inheritDoc}
1960     * <p>
1961     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1962     * driver does not support any updates.
1963     * </p>
1964     * 
1965     * @see java.sql.ResultSet#updateLong(java.lang.String, long)
1966     */
1967    @Override
1968    public void updateLong( String columnLabel,
1969                            long x ) throws SQLException {
1970        notClosed();
1971        noUpdates();
1972    }
1973
1974    /**
1975     * {@inheritDoc}
1976     * <p>
1977     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1978     * driver does not support any updates.
1979     * </p>
1980     * 
1981     * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader)
1982     */
1983    @Override
1984    public void updateNCharacterStream( int columnIndex,
1985                                        Reader x ) throws SQLException {
1986        notClosed();
1987        noUpdates();
1988    }
1989
1990    /**
1991     * {@inheritDoc}
1992     * <p>
1993     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
1994     * driver does not support any updates.
1995     * </p>
1996     * 
1997     * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader)
1998     */
1999    @Override
2000    public void updateNCharacterStream( String columnLabel,
2001                                        Reader reader ) throws SQLException {
2002        notClosed();
2003        noUpdates();
2004    }
2005
2006    /**
2007     * {@inheritDoc}
2008     * <p>
2009     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2010     * driver does not support any updates.
2011     * </p>
2012     * 
2013     * @see java.sql.ResultSet#updateNCharacterStream(int, java.io.Reader, long)
2014     */
2015    @Override
2016    public void updateNCharacterStream( int columnIndex,
2017                                        Reader x,
2018                                        long length ) throws SQLException {
2019        notClosed();
2020        noUpdates();
2021    }
2022
2023    /**
2024     * {@inheritDoc}
2025     * <p>
2026     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2027     * driver does not support any updates.
2028     * </p>
2029     * 
2030     * @see java.sql.ResultSet#updateNCharacterStream(java.lang.String, java.io.Reader, long)
2031     */
2032    @Override
2033    public void updateNCharacterStream( String columnLabel,
2034                                        Reader reader,
2035                                        long length ) throws SQLException {
2036        notClosed();
2037        noUpdates();
2038    }
2039
2040    /**
2041     * {@inheritDoc}
2042     * <p>
2043     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2044     * driver does not support any updates.
2045     * </p>
2046     * 
2047     * @see java.sql.ResultSet#updateNClob(int, java.sql.NClob)
2048     */
2049    @Override
2050    public void updateNClob( int columnIndex,
2051                             NClob clob ) throws SQLException {
2052        notClosed();
2053        noUpdates();
2054    }
2055
2056    /**
2057     * {@inheritDoc}
2058     * <p>
2059     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2060     * driver does not support any updates.
2061     * </p>
2062     * 
2063     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.sql.NClob)
2064     */
2065    @Override
2066    public void updateNClob( String columnLabel,
2067                             NClob clob ) throws SQLException {
2068        notClosed();
2069        noUpdates();
2070    }
2071
2072    /**
2073     * {@inheritDoc}
2074     * <p>
2075     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2076     * driver does not support any updates.
2077     * </p>
2078     * 
2079     * @see java.sql.ResultSet#updateNClob(int, java.io.Reader)
2080     */
2081    @Override
2082    public void updateNClob( int columnIndex,
2083                             Reader reader ) throws SQLException {
2084        notClosed();
2085        noUpdates();
2086    }
2087
2088    /**
2089     * {@inheritDoc}
2090     * <p>
2091     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2092     * driver does not support any updates.
2093     * </p>
2094     * 
2095     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader)
2096     */
2097    @Override
2098    public void updateNClob( String columnLabel,
2099                             Reader reader ) throws SQLException {
2100        notClosed();
2101        noUpdates();
2102    }
2103
2104    /**
2105     * {@inheritDoc}
2106     * <p>
2107     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2108     * driver does not support any updates.
2109     * </p>
2110     * 
2111     * @see java.sql.ResultSet#updateNClob(int, java.io.Reader, long)
2112     */
2113    @Override
2114    public void updateNClob( int columnIndex,
2115                             Reader reader,
2116                             long length ) throws SQLException {
2117        notClosed();
2118        noUpdates();
2119    }
2120
2121    /**
2122     * {@inheritDoc}
2123     * <p>
2124     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2125     * driver does not support any updates.
2126     * </p>
2127     * 
2128     * @see java.sql.ResultSet#updateNClob(java.lang.String, java.io.Reader, long)
2129     */
2130    @Override
2131    public void updateNClob( String columnLabel,
2132                             Reader reader,
2133                             long length ) throws SQLException {
2134        notClosed();
2135        noUpdates();
2136    }
2137
2138    /**
2139     * {@inheritDoc}
2140     * <p>
2141     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2142     * driver does not support any updates.
2143     * </p>
2144     * 
2145     * @see java.sql.ResultSet#updateNString(int, java.lang.String)
2146     */
2147    @Override
2148    public void updateNString( int columnIndex,
2149                               String string ) throws SQLException {
2150        notClosed();
2151        noUpdates();
2152    }
2153
2154    /**
2155     * {@inheritDoc}
2156     * <p>
2157     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2158     * driver does not support any updates.
2159     * </p>
2160     * 
2161     * @see java.sql.ResultSet#updateNString(java.lang.String, java.lang.String)
2162     */
2163    @Override
2164    public void updateNString( String columnLabel,
2165                               String string ) throws SQLException {
2166        notClosed();
2167        noUpdates();
2168    }
2169
2170    /**
2171     * {@inheritDoc}
2172     * <p>
2173     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2174     * driver does not support any updates.
2175     * </p>
2176     * 
2177     * @see java.sql.ResultSet#updateNull(int)
2178     */
2179    @Override
2180    public void updateNull( int columnIndex ) throws SQLException {
2181        notClosed();
2182        noUpdates();
2183    }
2184
2185    /**
2186     * {@inheritDoc}
2187     * <p>
2188     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2189     * driver does not support any updates.
2190     * </p>
2191     * 
2192     * @see java.sql.ResultSet#updateNull(java.lang.String)
2193     */
2194    @Override
2195    public void updateNull( String columnLabel ) throws SQLException {
2196        notClosed();
2197        noUpdates();
2198    }
2199
2200    /**
2201     * {@inheritDoc}
2202     * <p>
2203     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2204     * driver does not support any updates.
2205     * </p>
2206     * 
2207     * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
2208     */
2209    @Override
2210    public void updateObject( int columnIndex,
2211                              Object x ) throws SQLException {
2212        notClosed();
2213        noUpdates();
2214    }
2215
2216    /**
2217     * {@inheritDoc}
2218     * <p>
2219     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2220     * driver does not support any updates.
2221     * </p>
2222     * 
2223     * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
2224     */
2225    @Override
2226    public void updateObject( String columnLabel,
2227                              Object x ) throws SQLException {
2228        notClosed();
2229        noUpdates();
2230    }
2231
2232    /**
2233     * {@inheritDoc}
2234     * <p>
2235     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2236     * driver does not support any updates.
2237     * </p>
2238     * 
2239     * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
2240     */
2241    @Override
2242    public void updateObject( int columnIndex,
2243                              Object x,
2244                              int scaleOrLength ) throws SQLException {
2245        notClosed();
2246        noUpdates();
2247    }
2248
2249    /**
2250     * {@inheritDoc}
2251     * <p>
2252     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2253     * driver does not support any updates.
2254     * </p>
2255     * 
2256     * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
2257     */
2258    @Override
2259    public void updateObject( String columnLabel,
2260                              Object x,
2261                              int scaleOrLength ) throws SQLException {
2262        notClosed();
2263        noUpdates();
2264    }
2265
2266    /**
2267     * {@inheritDoc}
2268     * <p>
2269     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2270     * driver does not support any updates.
2271     * </p>
2272     * 
2273     * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
2274     */
2275    @Override
2276    public void updateRef( int columnIndex,
2277                           Ref x ) throws SQLException {
2278        notClosed();
2279        noUpdates();
2280    }
2281
2282    /**
2283     * {@inheritDoc}
2284     * <p>
2285     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2286     * driver does not support any updates.
2287     * </p>
2288     * 
2289     * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
2290     */
2291    @Override
2292    public void updateRef( String columnLabel,
2293                           Ref x ) throws SQLException {
2294        notClosed();
2295        noUpdates();
2296    }
2297
2298    /**
2299     * {@inheritDoc}
2300     * <p>
2301     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2302     * driver does not support any updates.
2303     * </p>
2304     * 
2305     * @see java.sql.ResultSet#updateRow()
2306     */
2307    @Override
2308    public void updateRow() throws SQLException {
2309        notClosed();
2310        noUpdates();
2311    }
2312
2313    /**
2314     * {@inheritDoc}
2315     * <p>
2316     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2317     * driver does not support any updates.
2318     * </p>
2319     * 
2320     * @see java.sql.ResultSet#updateRowId(int, java.sql.RowId)
2321     */
2322    @Override
2323    public void updateRowId( int columnIndex,
2324                             RowId x ) throws SQLException {
2325        notClosed();
2326        noUpdates();
2327    }
2328
2329    /**
2330     * {@inheritDoc}
2331     * <p>
2332     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2333     * driver does not support any updates.
2334     * </p>
2335     * 
2336     * @see java.sql.ResultSet#updateRowId(java.lang.String, java.sql.RowId)
2337     */
2338    @Override
2339    public void updateRowId( String columnLabel,
2340                             RowId x ) throws SQLException {
2341        notClosed();
2342        noUpdates();
2343    }
2344
2345    /**
2346     * {@inheritDoc}
2347     * <p>
2348     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2349     * driver does not support any updates.
2350     * </p>
2351     * 
2352     * @see java.sql.ResultSet#updateSQLXML(int, java.sql.SQLXML)
2353     */
2354    @Override
2355    public void updateSQLXML( int columnIndex,
2356                              SQLXML xmlObject ) throws SQLException {
2357        notClosed();
2358        noUpdates();
2359    }
2360
2361    /**
2362     * {@inheritDoc}
2363     * <p>
2364     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2365     * driver does not support any updates.
2366     * </p>
2367     * 
2368     * @see java.sql.ResultSet#updateSQLXML(java.lang.String, java.sql.SQLXML)
2369     */
2370    @Override
2371    public void updateSQLXML( String columnLabel,
2372                              SQLXML xmlObject ) throws SQLException {
2373        notClosed();
2374        noUpdates();
2375    }
2376
2377    /**
2378     * {@inheritDoc}
2379     * <p>
2380     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2381     * driver does not support any updates.
2382     * </p>
2383     * 
2384     * @see java.sql.ResultSet#updateShort(int, short)
2385     */
2386    @Override
2387    public void updateShort( int columnIndex,
2388                             short x ) throws SQLException {
2389        notClosed();
2390        noUpdates();
2391    }
2392
2393    /**
2394     * {@inheritDoc}
2395     * <p>
2396     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2397     * driver does not support any updates.
2398     * </p>
2399     * 
2400     * @see java.sql.ResultSet#updateShort(java.lang.String, short)
2401     */
2402    @Override
2403    public void updateShort( String columnLabel,
2404                             short x ) throws SQLException {
2405        notClosed();
2406        noUpdates();
2407    }
2408
2409    /**
2410     * {@inheritDoc}
2411     * <p>
2412     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2413     * driver does not support any updates.
2414     * </p>
2415     * 
2416     * @see java.sql.ResultSet#updateString(int, java.lang.String)
2417     */
2418    @Override
2419    public void updateString( int columnIndex,
2420                              String x ) throws SQLException {
2421        notClosed();
2422        noUpdates();
2423    }
2424
2425    /**
2426     * {@inheritDoc}
2427     * <p>
2428     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2429     * driver does not support any updates.
2430     * </p>
2431     * 
2432     * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
2433     */
2434    @Override
2435    public void updateString( String columnLabel,
2436                              String x ) throws SQLException {
2437        notClosed();
2438        noUpdates();
2439    }
2440
2441    /**
2442     * {@inheritDoc}
2443     * <p>
2444     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2445     * driver does not support any updates.
2446     * </p>
2447     * 
2448     * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
2449     */
2450    @Override
2451    public void updateTime( int columnIndex,
2452                            Time x ) throws SQLException {
2453        notClosed();
2454        noUpdates();
2455    }
2456
2457    /**
2458     * {@inheritDoc}
2459     * <p>
2460     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2461     * driver does not support any updates.
2462     * </p>
2463     * 
2464     * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
2465     */
2466    @Override
2467    public void updateTime( String columnLabel,
2468                            Time x ) throws SQLException {
2469        notClosed();
2470        noUpdates();
2471    }
2472
2473    /**
2474     * {@inheritDoc}
2475     * <p>
2476     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2477     * driver does not support any updates.
2478     * </p>
2479     * 
2480     * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
2481     */
2482    @Override
2483    public void updateTimestamp( int columnIndex,
2484                                 Timestamp x ) throws SQLException {
2485        notClosed();
2486        noUpdates();
2487    }
2488
2489    /**
2490     * {@inheritDoc}
2491     * <p>
2492     * This method, when called on an open result set, always throws {@link SQLFeatureNotSupportedException} since this JDBC
2493     * driver does not support any updates.
2494     * </p>
2495     * 
2496     * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
2497     */
2498    @Override
2499    public void updateTimestamp( String columnLabel,
2500                                 Timestamp x ) throws SQLException {
2501        notClosed();
2502        noUpdates();
2503    }
2504
2505    @Override
2506    public boolean wasNull() throws SQLException {
2507        notClosed();
2508
2509        return currentValue == null;
2510    }
2511
2512    @Override
2513    public boolean isWrapperFor( Class<?> iface ) {
2514        return iface.isInstance(this);
2515    }
2516
2517    @Override
2518    public <T> T unwrap( Class<T> iface ) throws SQLException {
2519        if (iface.isInstance(this)) {
2520            return iface.cast(this);
2521        }
2522
2523        throw new SQLException(JdbcLocalI18n.classDoesNotImplementInterface.text());
2524    }
2525
2526}