1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.modeshape.jdbc;
25
26 import java.io.IOException;
27 import java.io.InputStream;
28 import java.io.Reader;
29 import java.math.BigDecimal;
30 import java.net.URL;
31 import java.sql.Array;
32 import java.sql.Blob;
33 import java.sql.Clob;
34 import java.sql.Date;
35 import java.sql.NClob;
36 import java.sql.Ref;
37 import java.sql.ResultSet;
38 import java.sql.ResultSetMetaData;
39 import java.sql.RowId;
40 import java.sql.SQLException;
41 import java.sql.SQLFeatureNotSupportedException;
42 import java.sql.SQLWarning;
43 import java.sql.SQLXML;
44 import java.sql.Statement;
45 import java.sql.Time;
46 import java.sql.Timestamp;
47 import java.util.Calendar;
48 import java.util.Collections;
49 import java.util.HashMap;
50 import java.util.Map;
51 import javax.jcr.ItemNotFoundException;
52 import javax.jcr.PathNotFoundException;
53 import javax.jcr.PropertyType;
54 import javax.jcr.RepositoryException;
55 import javax.jcr.Value;
56 import javax.jcr.ValueFormatException;
57 import javax.jcr.query.QueryResult;
58 import javax.jcr.query.Row;
59 import javax.jcr.query.RowIterator;
60 import org.modeshape.jdbc.util.IoUtil;
61 import org.modeshape.jdbc.util.TimestampWithTimezone;
62
63
64
65
66 public class JcrResultSet implements ResultSet {
67
68 private boolean closed;
69 private JcrStatement statement;
70 private QueryResult jcrResults;
71 private ResultSetMetaData metadata;
72 private RowIterator rowIter;
73 private Row row;
74
75
76 private Object currentValue = null;
77
78 private Map<String, Integer> columnIndexesByName;
79
80 private String[] columnIDs = null;
81
82
83 private Calendar defaultCalendar;
84
85
86 protected JcrResultSet( JcrStatement statement,
87 QueryResult jcrResults,
88 ResultSetMetaData resultSetMetaData ) throws SQLException {
89 this.statement = statement;
90 this.jcrResults = jcrResults;
91 assert this.statement != null;
92 assert this.jcrResults != null;
93
94 if (resultSetMetaData != null) {
95 this.metadata = resultSetMetaData;
96 } else {
97 this.metadata = new JcrResultSetMetaData(this.statement.connection(), this.jcrResults);
98 }
99 int index = 1;
100 int colCnt = this.metadata.getColumnCount();
101
102
103 columnIDs = new String[colCnt + 1];
104 columnIndexesByName = new HashMap<String, Integer>(colCnt);
105 while (index <= colCnt) {
106 String name = this.metadata.getColumnName(index);
107 columnIndexesByName.put(name, index);
108 columnIDs[index] = name;
109 index++;
110 }
111
112 assert !columnIndexesByName.isEmpty();
113 this.columnIndexesByName = Collections.unmodifiableMap(columnIndexesByName);
114
115 try {
116 this.rowIter = this.jcrResults.getRows();
117 } catch (RepositoryException e) {
118 throw new SQLException(e.getLocalizedMessage(), e);
119 }
120 }
121
122
123
124
125
126
127 protected JcrResultSet() {
128 closed = true;
129 columnIndexesByName = Collections.emptyMap();
130 }
131
132
133 Calendar getDefaultCalendar() {
134 if (defaultCalendar == null) {
135 defaultCalendar = TimestampWithTimezone.getCalendar();
136 }
137 return defaultCalendar;
138 }
139
140
141
142
143
144
145 @Override
146 public boolean isClosed() {
147 return closed || statement.isClosed();
148 }
149
150
151
152
153
154
155 @Override
156 public void close() {
157 if (!closed) {
158 closed = true;
159 this.statement.close();
160 }
161 }
162
163 byte[] convertToByteArray( final Value value ) throws SQLException {
164 if (value == null) return null;
165 InputStream is = null;
166 boolean error = false;
167 try {
168 switch (value.getType()) {
169 case PropertyType.STRING:
170 case PropertyType.BOOLEAN:
171 case PropertyType.DOUBLE:
172
173 String v = value.getString();
174 return (v != null ? v.getBytes() : null);
175
176 case PropertyType.BINARY:
177 is = value.getBinary().getStream();
178 return IoUtil.readBytes(is);
179 default:
180 return null;
181 }
182
183 } catch (IOException ioe) {
184 error = true;
185 throw new SQLException(ioe.getLocalizedMessage(), ioe);
186 } catch (IllegalStateException ie) {
187 error = true;
188 throw new SQLException(ie.getLocalizedMessage(), ie);
189 } catch (RepositoryException e) {
190 error = true;
191 throw new SQLException(e.getLocalizedMessage(), e);
192 } finally {
193 try {
194 if (is != null) is.close();
195 } catch (Exception e) {
196 if (!error) throw new SQLException(e.getLocalizedMessage(), e);
197 }
198 }
199 }
200
201 protected final void notClosed() throws SQLException {
202 if (isClosed()) throw new SQLException(JdbcI18n.resultSetIsClosed.text());
203 }
204
205 protected final void noUpdates() throws SQLException {
206 throw new SQLFeatureNotSupportedException(JdbcI18n.updatesNotSupported.text());
207 }
208
209 protected final void forwardOnly() throws SQLException {
210 throw new SQLException(JdbcI18n.resultSetIsForwardOnly.text());
211 }
212
213 protected final void itemNotFoundUsingColunName( String columnName ) throws SQLException {
214 throw new SQLException(JdbcI18n.noSuchColumn.text(columnName));
215 }
216
217 protected final void itemNotFoundUsingColunIndex( int idx ) throws SQLException {
218 throw new SQLException(JdbcI18n.noSuchColumn.text(String.valueOf(idx)));
219 }
220
221
222
223
224
225
226 @Override
227 public ResultSetMetaData getMetaData() throws SQLException {
228 notClosed();
229 return metadata;
230 }
231
232
233
234
235
236
237 @Override
238 public Statement getStatement() throws SQLException {
239 notClosed();
240 return statement;
241 }
242
243
244
245
246
247
248
249
250
251 @Override
252 public int getType() throws SQLException {
253 notClosed();
254 return ResultSet.TYPE_FORWARD_ONLY;
255 }
256
257
258
259
260
261
262
263
264
265 @Override
266 public int getFetchDirection() throws SQLException {
267 notClosed();
268 return ResultSet.FETCH_FORWARD;
269 }
270
271
272
273
274
275
276
277
278
279
280 @Override
281 public void setFetchDirection( int direction ) throws SQLException {
282 throw new SQLFeatureNotSupportedException();
283 }
284
285
286
287
288
289
290
291
292
293
294 @Override
295 public boolean absolute( int row ) throws SQLException {
296 notClosed();
297 forwardOnly();
298
299 return false;
300 }
301
302
303
304
305
306
307
308
309
310
311 @Override
312 public void afterLast() throws SQLException {
313 notClosed();
314 forwardOnly();
315 }
316
317
318
319
320
321
322
323
324
325
326 @Override
327 public void beforeFirst() throws SQLException {
328 notClosed();
329 forwardOnly();
330
331 }
332
333
334
335
336
337
338 @Override
339 public void cancelRowUpdates() throws SQLException {
340 notClosed();
341 noUpdates();
342 }
343
344
345
346
347
348
349 @Override
350 public void clearWarnings() throws SQLException {
351 notClosed();
352 }
353
354
355
356
357
358
359 @Override
360 public void deleteRow() throws SQLException {
361 notClosed();
362 noUpdates();
363 }
364
365
366
367
368
369
370 @Override
371 public int findColumn( String columnLabel ) throws SQLException {
372 notClosed();
373 final Integer result = columnLabel != null ? columnIndexesByName.get(columnLabel) : null;
374
375 if (result == null) {
376 this.itemNotFoundUsingColunName(columnLabel);
377 }
378 assert result != null;
379 return result.intValue();
380 }
381
382 private String findColumn( int columnIndex ) throws SQLException {
383 if (columnIndex > 0 && columnIndex < this.columnIDs.length) {
384 return columnIDs[columnIndex];
385 }
386
387 throw new SQLException(JdbcI18n.invalidColumnIndex.text(new Object[] {columnIndex, this.columnIDs.length}));
388 }
389
390
391
392
393
394
395
396
397
398
399 @Override
400 public boolean first() throws SQLException {
401 notClosed();
402 forwardOnly();
403
404 return false;
405 }
406
407
408
409
410
411
412 @Override
413 public int getRow() throws SQLException {
414 notClosed();
415 return (int)this.rowIter.getPosition();
416 }
417
418
419
420
421
422
423
424
425
426 @Override
427 public RowId getRowId( final int columnIndex ) throws SQLException {
428 throw new SQLFeatureNotSupportedException();
429 }
430
431
432
433
434
435
436 @Override
437 public RowId getRowId( String columnLabel ) throws SQLException {
438 throw new SQLFeatureNotSupportedException();
439 }
440
441
442
443
444
445
446 @Override
447 public String getCursorName() throws SQLException {
448 throw new SQLFeatureNotSupportedException();
449 }
450
451
452
453
454
455
456 @Override
457 public int getFetchSize() throws SQLException {
458 notClosed();
459 return statement.getFetchSize();
460 }
461
462
463
464
465
466
467 @Override
468 public Array getArray( int columnIndex ) throws SQLException {
469 throw new SQLFeatureNotSupportedException();
470 }
471
472
473
474
475
476
477 @Override
478 public Array getArray( String columnLabel ) throws SQLException {
479 throw new SQLFeatureNotSupportedException();
480 }
481
482
483
484
485
486
487 @Override
488 public InputStream getAsciiStream( int columnIndex ) throws SQLException {
489 throw new SQLFeatureNotSupportedException();
490 }
491
492
493
494
495
496
497 @Override
498 public InputStream getAsciiStream( String columnLabel ) throws SQLException {
499 throw new SQLFeatureNotSupportedException();
500 }
501
502
503
504
505
506
507 @Override
508 public BigDecimal getBigDecimal( int columnIndex ) throws SQLException {
509 throw new SQLFeatureNotSupportedException();
510 }
511
512
513
514
515
516
517 @Override
518 public BigDecimal getBigDecimal( String columnLabel ) throws SQLException {
519 throw new SQLFeatureNotSupportedException();
520 }
521
522
523
524
525
526
527 @Override
528 public BigDecimal getBigDecimal( int columnIndex,
529 int scale ) throws SQLException {
530 throw new SQLFeatureNotSupportedException();
531 }
532
533
534
535
536
537
538 @Override
539 public BigDecimal getBigDecimal( String columnLabel,
540 int scale ) throws SQLException {
541 throw new SQLFeatureNotSupportedException();
542 }
543
544
545
546
547
548
549 @Override
550 public InputStream getBinaryStream( int columnIndex ) throws SQLException {
551 return getBinaryStream(findColumn(columnIndex));
552 }
553
554
555
556
557
558
559 @Override
560 public InputStream getBinaryStream( String columnLabel ) throws SQLException {
561 Object o = getValueReturn(columnLabel, PropertyType.BINARY);
562 if (o != null) {
563 return (InputStream) o;
564 }
565 return null;
566 }
567
568
569
570
571
572
573 @Override
574 public Blob getBlob( int columnIndex ) throws SQLException {
575 throw new SQLFeatureNotSupportedException();
576 }
577
578
579
580
581
582
583 @Override
584 public Blob getBlob( String columnLabel ) throws SQLException {
585 throw new SQLFeatureNotSupportedException();
586 }
587
588
589
590
591
592
593 @Override
594 public boolean getBoolean( int columnIndex ) throws SQLException {
595 return getBoolean(findColumn(columnIndex));
596 }
597
598
599
600
601
602
603 @Override
604 public boolean getBoolean( String columnLabel ) throws SQLException {
605
606 Object o = getValueReturn(columnLabel, PropertyType.BOOLEAN);
607 if (o != null) {
608 return ((Boolean) o).booleanValue();
609 }
610 return Boolean.FALSE.booleanValue();
611 }
612
613
614
615
616
617
618 @Override
619 public byte getByte( int columnIndex ) throws SQLException {
620 throw new SQLFeatureNotSupportedException();
621 }
622
623
624
625
626
627
628 @Override
629 public byte getByte( String columnLabel ) throws SQLException {
630 throw new SQLFeatureNotSupportedException();
631 }
632
633
634
635
636
637
638 @Override
639 public byte[] getBytes( int columnIndex ) throws SQLException {
640 return getBytes(findColumn(columnIndex));
641 }
642
643
644
645
646
647
648 @Override
649 public byte[] getBytes( String columnLabel ) throws SQLException {
650 notClosed();
651 isRowSet();
652
653 this.currentValue = null;
654 try {
655 Value value = row.getValue(columnLabel);
656 byte[] rtnbytes = convertToByteArray(value);
657 this.currentValue = rtnbytes;
658 return rtnbytes;
659 } catch (PathNotFoundException pnfe) {
660
661 } catch (ItemNotFoundException e) {
662 itemNotFoundUsingColunName(columnLabel);
663 } catch (RepositoryException e) {
664 throw new SQLException(e.getLocalizedMessage(), e);
665 }
666 return null;
667 }
668
669
670
671
672
673
674 @Override
675 public Reader getCharacterStream( int columnIndex ) throws SQLException {
676 throw new SQLFeatureNotSupportedException();
677 }
678
679
680
681
682
683
684 @Override
685 public Reader getCharacterStream( String columnLabel ) throws SQLException {
686 throw new SQLFeatureNotSupportedException();
687 }
688
689
690
691
692
693
694 @Override
695 public Clob getClob( int columnIndex ) throws SQLException {
696 throw new SQLFeatureNotSupportedException();
697 }
698
699
700
701
702
703
704 @Override
705 public Clob getClob( String columnLabel ) throws SQLException {
706 throw new SQLFeatureNotSupportedException();
707 }
708
709
710
711
712
713
714 @Override
715 public int getConcurrency() throws SQLException {
716 notClosed();
717 return 0;
718 }
719
720
721
722
723
724
725 @Override
726 public Date getDate( int columnIndex ) throws SQLException {
727 return getDate(findColumn(columnIndex));
728 }
729
730
731
732
733
734
735 @Override
736 public Date getDate( String columnLabel ) throws SQLException {
737 Calendar calv = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
738 if (calv == null) return null;
739
740 return TimestampWithTimezone.createDate(calv);
741 }
742
743
744
745
746
747
748 @Override
749 public Date getDate( int columnIndex,
750 Calendar cal ) throws SQLException {
751 return getDate(findColumn(columnIndex), cal);
752 }
753
754
755
756
757
758
759 @Override
760 public Date getDate( String columnLabel,
761 Calendar cal ) throws SQLException {
762
763 Calendar actual = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
764
765 if (actual == null) return null;
766
767 return TimestampWithTimezone.createDate(actual, cal);
768
769 }
770
771
772
773
774
775
776 @Override
777 public double getDouble( int columnIndex ) throws SQLException {
778 return getDouble(findColumn(columnIndex));
779 }
780
781
782
783
784
785
786 @Override
787 public double getDouble( String columnLabel ) throws SQLException {
788 Object o = getValueReturn(columnLabel, PropertyType.DOUBLE);
789 if (o != null) {
790 return ((Double) o).doubleValue();
791 }
792 return 0;
793 }
794
795
796
797
798
799
800 @Override
801 public float getFloat( int columnIndex ) throws SQLException {
802 throw new SQLFeatureNotSupportedException();
803 }
804
805
806
807
808
809
810 @Override
811 public float getFloat( String columnLabel ) throws SQLException {
812 throw new SQLFeatureNotSupportedException();
813 }
814
815
816
817
818
819
820
821
822
823
824 @Override
825 public int getHoldability() throws SQLException {
826 notClosed();
827 return 0;
828 }
829
830
831
832
833
834
835 @Override
836 public int getInt( int columnIndex ) throws SQLException {
837 return getInt(findColumn(columnIndex));
838 }
839
840
841
842
843
844
845 @Override
846 public int getInt( String columnLabel ) throws SQLException {
847 notClosed();
848 return (int)getLong(columnLabel);
849 }
850
851
852
853
854
855
856 @Override
857 public long getLong( int columnIndex ) throws SQLException {
858 return getLong(findColumn(columnIndex));
859 }
860
861
862
863
864
865
866 @Override
867 public long getLong( String columnLabel ) throws SQLException {
868 Object o = getValueReturn(columnLabel, PropertyType.LONG);
869 if (o != null) {
870 return ( (Long) o).longValue();
871 }
872 return 0L;
873 }
874
875
876
877
878
879
880 @Override
881 public Reader getNCharacterStream( int columnIndex ) throws SQLException {
882 throw new SQLFeatureNotSupportedException();
883 }
884
885
886
887
888
889
890 @Override
891 public Reader getNCharacterStream( String columnLabel ) throws SQLException {
892 throw new SQLFeatureNotSupportedException();
893 }
894
895
896
897
898
899
900 @Override
901 public NClob getNClob( int columnIndex ) throws SQLException {
902 throw new SQLFeatureNotSupportedException();
903 }
904
905
906
907
908
909
910 @Override
911 public NClob getNClob( String columnLabel ) throws SQLException {
912 throw new SQLFeatureNotSupportedException();
913 }
914
915
916
917
918
919
920 @Override
921 public String getNString( int columnIndex ) throws SQLException {
922 throw new SQLFeatureNotSupportedException();
923 }
924
925
926
927
928
929
930
931 @Override
932 public String getNString( String columnLabel ) throws SQLException {
933 throw new SQLFeatureNotSupportedException();
934 }
935
936
937
938
939
940
941 @Override
942 public Object getObject( int columnIndex ) throws SQLException {
943 return getObject(findColumn(columnIndex));
944 }
945
946
947
948
949
950
951 @Override
952 public Object getObject( String columnLabel ) throws SQLException {
953 return getColumnTranslatedToJDBC(columnLabel);
954 }
955
956
957
958
959
960
961 @Override
962 public Object getObject( int columnIndex,
963 Map<String, Class<?>> map ) throws SQLException {
964 throw new SQLFeatureNotSupportedException();
965 }
966
967
968
969
970
971
972 @Override
973 public Object getObject( String columnLabel,
974 Map<String, Class<?>> map ) throws SQLException {
975 throw new SQLFeatureNotSupportedException();
976
977 }
978
979
980
981
982
983
984 @Override
985 public Ref getRef( int columnIndex ) throws SQLException {
986 throw new SQLFeatureNotSupportedException();
987 }
988
989
990
991
992
993
994 @Override
995 public Ref getRef( String columnLabel ) throws SQLException {
996 throw new SQLFeatureNotSupportedException();
997 }
998
999
1000
1001
1002
1003
1004 @Override
1005 public SQLXML getSQLXML( int columnIndex ) throws SQLException {
1006 throw new SQLFeatureNotSupportedException();
1007 }
1008
1009
1010
1011
1012
1013
1014 @Override
1015 public SQLXML getSQLXML( String columnLabel ) throws SQLException {
1016 throw new SQLFeatureNotSupportedException();
1017 }
1018
1019
1020
1021
1022
1023
1024 @Override
1025 public short getShort( int columnIndex ) throws SQLException {
1026 throw new SQLFeatureNotSupportedException();
1027 }
1028
1029
1030
1031
1032
1033
1034 @Override
1035 public short getShort( String columnLabel ) throws SQLException {
1036 throw new SQLFeatureNotSupportedException();
1037 }
1038
1039
1040
1041
1042
1043
1044 @Override
1045 public String getString( int columnIndex ) throws SQLException {
1046 return getString(findColumn(columnIndex));
1047 }
1048
1049
1050
1051
1052
1053
1054 @Override
1055 public String getString( String columnLabel ) throws SQLException {
1056 Object o = getValueReturn(columnLabel, PropertyType.STRING);
1057 if (o != null) {
1058 return (String) o;
1059 }
1060 return null;
1061 }
1062
1063
1064
1065
1066
1067
1068 @Override
1069 public Time getTime( int columnIndex ) throws SQLException {
1070 return getTime(findColumn(columnIndex));
1071 }
1072
1073
1074
1075
1076
1077
1078 @Override
1079 public Time getTime( String columnLabel ) throws SQLException {
1080 Calendar calv = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
1081 if (calv == null) return null;
1082
1083 return TimestampWithTimezone.createTime(calv);
1084 }
1085
1086
1087
1088
1089
1090
1091 @Override
1092 public Time getTime( int columnIndex,
1093 Calendar cal ) throws SQLException {
1094 return getTime(findColumn(columnIndex), cal);
1095 }
1096
1097
1098
1099
1100
1101
1102 @Override
1103 public Time getTime( String columnLabel,
1104 Calendar cal ) throws SQLException {
1105
1106 Calendar actual = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
1107
1108 if (actual == null) return null;
1109
1110
1111 return TimestampWithTimezone.createTime(actual, cal);
1112
1113 }
1114
1115
1116
1117
1118
1119
1120 @Override
1121 public Timestamp getTimestamp( int columnIndex ) throws SQLException {
1122 return getTimestamp(findColumn(columnIndex));
1123 }
1124
1125
1126
1127
1128
1129
1130 @Override
1131 public Timestamp getTimestamp( String columnLabel ) throws SQLException {
1132 Calendar calv = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
1133 if (calv == null) return null;
1134 return TimestampWithTimezone.createTimestamp(calv);
1135
1136 }
1137
1138
1139
1140
1141
1142
1143 @Override
1144 public Timestamp getTimestamp( int columnIndex,
1145 Calendar cal ) throws SQLException {
1146 return getTimestamp(findColumn(columnIndex), cal);
1147 }
1148
1149
1150
1151
1152
1153
1154 @Override
1155 public Timestamp getTimestamp( String columnLabel,
1156 Calendar cal ) throws SQLException {
1157
1158 Calendar actual = (Calendar)getValueReturn(columnLabel, PropertyType.DATE);
1159
1160 if (actual == null) return null;
1161
1162
1163 return TimestampWithTimezone.createTimestamp(actual, cal);
1164 }
1165
1166
1167
1168
1169
1170
1171 @Override
1172 public URL getURL( int columnIndex ) throws SQLException {
1173 throw new SQLFeatureNotSupportedException();
1174 }
1175
1176
1177
1178
1179
1180
1181 @Override
1182 public URL getURL( String columnLabel ) throws SQLException {
1183 throw new SQLFeatureNotSupportedException();
1184 }
1185
1186
1187
1188
1189
1190
1191 @Override
1192 public InputStream getUnicodeStream( int columnIndex ) throws SQLException {
1193 throw new SQLFeatureNotSupportedException();
1194 }
1195
1196
1197
1198
1199
1200
1201 @Override
1202 public InputStream getUnicodeStream( String columnLabel ) throws SQLException {
1203 throw new SQLFeatureNotSupportedException();
1204 }
1205
1206 public Value getValue( int columnIndex ) throws SQLException {
1207 return getValue(findColumn(columnIndex));
1208
1209 }
1210
1211 public Value getValue( String columnLabel ) throws SQLException {
1212 notClosed();
1213 isRowSet();
1214
1215 try {
1216 return row.getValue(columnLabel);
1217 } catch (PathNotFoundException pnfe) {
1218 return null;
1219 } catch (RepositoryException e) {
1220 throw new SQLException(e.getLocalizedMessage(), e);
1221 }
1222
1223 }
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234 private Object getValueReturn( String columnName,
1235 int type ) throws SQLException {
1236 notClosed();
1237 isRowSet();
1238
1239 this.currentValue = null;
1240 try {
1241
1242 final Value value = row.getValue(columnName);
1243 this.currentValue = getValueObject(value, type);
1244
1245 } catch (PathNotFoundException pnfe) {
1246
1247 } catch (ItemNotFoundException e) {
1248 itemNotFoundUsingColunName(columnName);
1249 } catch (RepositoryException e) {
1250 throw new SQLException(e.getLocalizedMessage(), e);
1251 }
1252 return this.currentValue;
1253 }
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263 private Object getValueObject( Value value,
1264 int type ) throws SQLException {
1265 if (value == null) return null;
1266
1267 try {
1268 switch (type) {
1269
1270 case PropertyType.STRING:
1271 return value.getString();
1272 case PropertyType.BOOLEAN:
1273 return value.getBoolean();
1274 case PropertyType.DATE:
1275 return value.getDate();
1276 case PropertyType.DOUBLE:
1277 return value.getDouble();
1278 case PropertyType.LONG:
1279 return value.getLong();
1280 case PropertyType.BINARY:
1281 return value.getBinary().getStream();
1282 }
1283
1284 } catch (ValueFormatException ve) {
1285 throw new SQLException(ve.getLocalizedMessage(), ve);
1286 } catch (IllegalStateException ie) {
1287 throw new SQLException(ie.getLocalizedMessage(), ie);
1288 } catch (RepositoryException e) {
1289 throw new SQLException(e.getLocalizedMessage(), e);
1290 }
1291 return value.toString();
1292 }
1293
1294
1295
1296
1297
1298
1299
1300
1301 private Object getColumnTranslatedToJDBC( String columnName ) throws SQLException {
1302 notClosed();
1303 isRowSet();
1304
1305 Value value = null;
1306 this.currentValue = null;
1307
1308 try {
1309 value = row.getValue(columnName);
1310 } catch (javax.jcr.PathNotFoundException pnf) {
1311
1312 } catch (RepositoryException e) {
1313 throw new SQLException(e.getLocalizedMessage(), e);
1314 }
1315
1316 if (value == null) return null;
1317
1318 this.currentValue = JcrType.translateValueToJDBC(value);
1319 return this.currentValue;
1320 }
1321
1322
1323
1324
1325
1326
1327 @Override
1328 public SQLWarning getWarnings()
1329 return null;
1330 }
1331
1332 protected boolean hasNext() {
1333 return rowIter.hasNext();
1334 }
1335
1336
1337
1338
1339
1340
1341 @Override
1342 public void insertRow() throws SQLException {
1343 this.notClosed();
1344 this.noUpdates();
1345 }
1346
1347
1348
1349
1350
1351
1352 @Override
1353 public boolean isAfterLast() throws SQLException {
1354 this.notClosed();
1355 if (this.row == null && !this.rowIter.hasNext() && this.rowIter.getPosition() == this.rowIter.getSize()) {
1356 return true;
1357 }
1358 return false;
1359
1360 }
1361
1362
1363
1364
1365
1366
1367 @Override
1368 public boolean isBeforeFirst() throws SQLException {
1369 this.notClosed();
1370 if (this.rowIter.getPosition() == 0) {
1371 return true;
1372 }
1373 return false;
1374 }
1375
1376
1377
1378
1379
1380
1381 @Override
1382 public boolean isFirst() throws SQLException {
1383 this.notClosed();
1384 if (this.rowIter.getPosition() == 1) {
1385 return true;
1386 }
1387 return false;
1388 }
1389
1390
1391
1392
1393
1394
1395 @Override
1396 public boolean isLast() throws SQLException {
1397 this.notClosed();
1398
1399 if (this.row != null && !this.rowIter.hasNext() && this.rowIter.getPosition() == this.rowIter.getSize()) {
1400 return true;
1401 }
1402 return false;
1403 }
1404
1405 protected final void isRowSet() throws SQLException {
1406 if (this.row != null) return;
1407
1408 throw new SQLException(JdbcI18n.currentRowNotSet.text());
1409 }
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420 @Override
1421 public boolean last() throws SQLException {
1422 notClosed();
1423 forwardOnly();
1424 return false;
1425 }
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436 @Override
1437 public void moveToCurrentRow() throws SQLException {
1438 notClosed();
1439 forwardOnly();
1440 }
1441
1442
1443
1444
1445
1446
1447 @Override
1448 public void moveToInsertRow() throws SQLException {
1449 this.noUpdates();
1450 }
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460 @Override
1461 public boolean next() throws SQLException {
1462 notClosed();
1463 if (!this.hasNext()) {
1464 this.row = null;
1465 this.currentValue = null;
1466 return false;
1467 }
1468
1469 this.row = rowIter.nextRow();
1470 return true;
1471 }
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482 @Override
1483 public boolean previous() throws SQLException {
1484 notClosed();
1485 this.forwardOnly();
1486 return false;
1487 }
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498 @Override
1499 public void refreshRow() throws SQLException {
1500 notClosed();
1501 this.forwardOnly();
1502 }
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513 @Override
1514 public boolean relative( int rows ) throws SQLException {
1515 throw new SQLFeatureNotSupportedException();
1516 }
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526 @Override
1527 public boolean rowDeleted() throws SQLException {
1528 throw new SQLFeatureNotSupportedException();
1529 }
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539 @Override
1540 public boolean rowInserted() throws SQLException {
1541 throw new SQLFeatureNotSupportedException();
1542 }
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552 @Override
1553 public boolean rowUpdated() throws SQLException {
1554 throw new SQLFeatureNotSupportedException();
1555 }
1556
1557
1558
1559
1560
1561
1562 @Override
1563 public void setFetchSize( int rows )
1564
1565 }
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576 @Override
1577 public void updateArray( int columnIndex,
1578 Array x ) throws SQLException {
1579 notClosed();
1580 noUpdates();
1581 }
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592 @Override
1593 public void updateArray( String columnLabel,
1594 Array x ) throws SQLException {
1595 notClosed();
1596 noUpdates();
1597 }
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608 @Override
1609 public void updateAsciiStream( int columnIndex,
1610 InputStream x ) throws SQLException {
1611 notClosed();
1612 noUpdates();
1613 }
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624 @Override
1625 public void updateAsciiStream( String columnLabel,
1626 InputStream x ) throws SQLException {
1627 notClosed();
1628 noUpdates();
1629 }
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640 @Override
1641 public void updateAsciiStream( int columnIndex,
1642 InputStream x,
1643 int length ) throws SQLException {
1644 notClosed();
1645 noUpdates();
1646 }
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657 @Override
1658 public void updateAsciiStream( String columnLabel,
1659 InputStream x,
1660 int length ) throws SQLException {
1661 notClosed();
1662 noUpdates();
1663 }
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674 @Override
1675 public void updateAsciiStream( int columnIndex,
1676 InputStream x,
1677 long length ) throws SQLException {
1678 notClosed();
1679 noUpdates();
1680 }
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691 @Override
1692 public void updateAsciiStream( String columnLabel,
1693 InputStream x,
1694 long length ) throws SQLException {
1695 notClosed();
1696 noUpdates();
1697 }
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708 @Override
1709 public void updateBigDecimal( int columnIndex,
1710 BigDecimal x ) throws SQLException {
1711 notClosed();
1712 noUpdates();
1713 }
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724 @Override
1725 public void updateBigDecimal( String columnLabel,
1726 BigDecimal x ) throws SQLException {
1727 notClosed();
1728 noUpdates();
1729 }
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740 @Override
1741 public void updateBinaryStream( int columnIndex,
1742 InputStream x ) throws SQLException {
1743 notClosed();
1744 noUpdates();
1745 }
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756 @Override
1757 public void updateBinaryStream( String columnLabel,
1758 InputStream x ) throws SQLException {
1759 notClosed();
1760 noUpdates();
1761 }
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772 @Override
1773 public void updateBinaryStream( int columnIndex,
1774 InputStream x,
1775 int length ) throws SQLException {
1776 notClosed();
1777 noUpdates();
1778 }
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789 @Override
1790 public void updateBinaryStream( String columnLabel,
1791 InputStream x,
1792 int length ) throws SQLException {
1793 notClosed();
1794 noUpdates();
1795 }
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806 @Override
1807 public void updateBinaryStream( int columnIndex,
1808 InputStream x,
1809 long length ) throws SQLException {
1810 notClosed();
1811 noUpdates();
1812 }
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823 @Override
1824 public void updateBinaryStream( String columnLabel,
1825 InputStream x,
1826 long length ) throws SQLException {
1827 notClosed();
1828 noUpdates();
1829 }
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840 @Override
1841 public void updateBlob( int columnIndex,
1842 Blob x ) throws SQLException {
1843 notClosed();
1844 noUpdates();
1845 }
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856 @Override
1857 public void updateBlob( String columnLabel,
1858 Blob x ) throws SQLException {
1859 notClosed();
1860 noUpdates();
1861 }
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872 @Override
1873 public void updateBlob( int columnIndex,
1874 InputStream inputStream ) throws SQLException {
1875 notClosed();
1876 noUpdates();
1877 }
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888 @Override
1889 public void updateBlob( String columnLabel,
1890 InputStream inputStream ) throws SQLException {
1891 notClosed();
1892 noUpdates();
1893 }
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904 @Override
1905 public void updateBlob( int columnIndex,
1906 InputStream inputStream,
1907 long length ) throws SQLException {
1908 notClosed();
1909 noUpdates();
1910 }
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921 @Override
1922 public void updateBlob( String columnLabel,
1923 InputStream inputStream,
1924 long length ) throws SQLException {
1925 notClosed();
1926 noUpdates();
1927 }
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938 @Override
1939 public void updateBoolean( int columnIndex,
1940 boolean x ) throws SQLException {
1941 notClosed();
1942 noUpdates();
1943 }
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954 @Override
1955 public void updateBoolean( String columnLabel,
1956 boolean x ) throws SQLException {
1957 notClosed();
1958 noUpdates();
1959 }
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970 @Override
1971 public void updateByte( int columnIndex,
1972 byte x ) throws SQLException {
1973 notClosed();
1974 noUpdates();
1975 }
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986 @Override
1987 public void updateByte( String columnLabel,
1988 byte x ) throws SQLException {
1989 notClosed();
1990 noUpdates();
1991 }
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002 @Override
2003 public void updateBytes( int columnIndex,
2004 byte[] x ) throws SQLException {
2005 notClosed();
2006 noUpdates();
2007 }
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018 @Override
2019 public void updateBytes( String columnLabel,
2020 byte[] x ) throws SQLException {
2021 notClosed();
2022 noUpdates();
2023 }
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034 @Override
2035 public void updateCharacterStream( int columnIndex,
2036 Reader x ) throws SQLException {
2037 notClosed();
2038 noUpdates();
2039 }
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050 @Override
2051 public void updateCharacterStream( String columnLabel,
2052 Reader reader ) throws SQLException {
2053 notClosed();
2054 noUpdates();
2055 }
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066 @Override
2067 public void updateCharacterStream( int columnIndex,
2068 Reader x,
2069 int length ) throws SQLException {
2070 notClosed();
2071 noUpdates();
2072 }
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083 @Override
2084 public void updateCharacterStream( String columnLabel,
2085 Reader reader,
2086 int length ) throws SQLException {
2087 notClosed();
2088 noUpdates();
2089 }
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100 @Override
2101 public void updateCharacterStream( int columnIndex,
2102 Reader x,
2103 long length ) throws SQLException {
2104 notClosed();
2105 noUpdates();
2106 }
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117 @Override
2118 public void updateCharacterStream( String columnLabel,
2119 Reader reader,
2120 long length ) throws SQLException {
2121 notClosed();
2122 noUpdates();
2123 }
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134 @Override
2135 public void updateClob( int columnIndex,
2136 Clob x ) throws SQLException {
2137 notClosed();
2138 noUpdates();
2139 }
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150 @Override
2151 public void updateClob( String columnLabel,
2152 Clob x ) throws SQLException {
2153 notClosed();
2154 noUpdates();
2155 }
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166 @Override
2167 public void updateClob( int columnIndex,
2168 Reader reader ) throws SQLException {
2169 notClosed();
2170 noUpdates();
2171 }
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182 @Override
2183 public void updateClob( String columnLabel,
2184 Reader reader ) throws SQLException {
2185 notClosed();
2186 noUpdates();
2187 }
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198 @Override
2199 public void updateClob( int columnIndex,
2200 Reader reader,
2201 long length ) throws SQLException {
2202 notClosed();
2203 noUpdates();
2204 }
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215 @Override
2216 public void updateClob( String columnLabel,
2217 Reader reader,
2218 long length ) throws SQLException {
2219 notClosed();
2220 noUpdates();
2221 }
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232 @Override
2233 public void updateDate( int columnIndex,
2234 Date x ) throws SQLException {
2235 notClosed();
2236 noUpdates();
2237 }
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248 @Override
2249 public void updateDate( String columnLabel,
2250 Date x ) throws SQLException {
2251 notClosed();
2252 noUpdates();
2253 }
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264 @Override
2265 public void updateDouble( int columnIndex,
2266 double x ) throws SQLException {
2267 notClosed();
2268 noUpdates();
2269 }
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280 @Override
2281 public void updateDouble( String columnLabel,
2282 double x ) throws SQLException {
2283 notClosed();
2284 noUpdates();
2285 }
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296 @Override
2297 public void updateFloat( int columnIndex,
2298 float x ) throws SQLException {
2299 notClosed();
2300 noUpdates();
2301 }
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312 @Override
2313 public void updateFloat( String columnLabel,
2314 float x ) throws SQLException {
2315 notClosed();
2316 noUpdates();
2317 }
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328 @Override
2329 public void updateInt( int columnIndex,
2330 int x ) throws SQLException {
2331 notClosed();
2332 noUpdates();
2333 }
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344 @Override
2345 public void updateInt( String columnLabel,
2346 int x ) throws SQLException {
2347 notClosed();
2348 noUpdates();
2349 }
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360 @Override
2361 public void updateLong( int columnIndex,
2362 long x ) throws SQLException {
2363 notClosed();
2364 noUpdates();
2365 }
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376 @Override
2377 public void updateLong( String columnLabel,
2378 long x ) throws SQLException {
2379 notClosed();
2380 noUpdates();
2381 }
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392 @Override
2393 public void updateNCharacterStream( int columnIndex,
2394 Reader x ) throws SQLException {
2395 notClosed();
2396 noUpdates();
2397 }
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408 @Override
2409 public void updateNCharacterStream( String columnLabel,
2410 Reader reader ) throws SQLException {
2411 notClosed();
2412 noUpdates();
2413 }
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424 @Override
2425 public void updateNCharacterStream( int columnIndex,
2426 Reader x,
2427 long length ) throws SQLException {
2428 notClosed();
2429 noUpdates();
2430 }
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441 @Override
2442 public void updateNCharacterStream( String columnLabel,
2443 Reader reader,
2444 long length ) throws SQLException {
2445 notClosed();
2446 noUpdates();
2447 }
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458 @Override
2459 public void updateNClob( int columnIndex,
2460 NClob clob ) throws SQLException {
2461 notClosed();
2462 noUpdates();
2463 }
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474 @Override
2475 public void updateNClob( String columnLabel,
2476 NClob clob ) throws SQLException {
2477 notClosed();
2478 noUpdates();
2479 }
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490 @Override
2491 public void updateNClob( int columnIndex,
2492 Reader reader ) throws SQLException {
2493 notClosed();
2494 noUpdates();
2495 }
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506 @Override
2507 public void updateNClob( String columnLabel,
2508 Reader reader ) throws SQLException {
2509 notClosed();
2510 noUpdates();
2511 }
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522 @Override
2523 public void updateNClob( int columnIndex,
2524 Reader reader,
2525 long length ) throws SQLException {
2526 notClosed();
2527 noUpdates();
2528 }
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539 @Override
2540 public void updateNClob( String columnLabel,
2541 Reader reader,
2542 long length ) throws SQLException {
2543 notClosed();
2544 noUpdates();
2545 }
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556 @Override
2557 public void updateNString( int columnIndex,
2558 String string ) throws SQLException {
2559 notClosed();
2560 noUpdates();
2561 }
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572 @Override
2573 public void updateNString( String columnLabel,
2574 String string ) throws SQLException {
2575 notClosed();
2576 noUpdates();
2577 }
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588 @Override
2589 public void updateNull( int columnIndex ) throws SQLException {
2590 notClosed();
2591 noUpdates();
2592 }
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603 @Override
2604 public void updateNull( String columnLabel ) throws SQLException {
2605 notClosed();
2606 noUpdates();
2607 }
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618 @Override
2619 public void updateObject( int columnIndex,
2620 Object x ) throws SQLException {
2621 notClosed();
2622 noUpdates();
2623 }
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634 @Override
2635 public void updateObject( String columnLabel,
2636 Object x ) throws SQLException {
2637 notClosed();
2638 noUpdates();
2639 }
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650 @Override
2651 public void updateObject( int columnIndex,
2652 Object x,
2653 int scaleOrLength ) throws SQLException {
2654 notClosed();
2655 noUpdates();
2656 }
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667 @Override
2668 public void updateObject( String columnLabel,
2669 Object x,
2670 int scaleOrLength ) throws SQLException {
2671 notClosed();
2672 noUpdates();
2673 }
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684 @Override
2685 public void updateRef( int columnIndex,
2686 Ref x ) throws SQLException {
2687 notClosed();
2688 noUpdates();
2689 }
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700 @Override
2701 public void updateRef( String columnLabel,
2702 Ref x ) throws SQLException {
2703 notClosed();
2704 noUpdates();
2705 }
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716 @Override
2717 public void updateRow() throws SQLException {
2718 notClosed();
2719 noUpdates();
2720 }
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731 @Override
2732 public void updateRowId( int columnIndex,
2733 RowId x ) throws SQLException {
2734 notClosed();
2735 noUpdates();
2736 }
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747 @Override
2748 public void updateRowId( String columnLabel,
2749 RowId x ) throws SQLException {
2750 notClosed();
2751 noUpdates();
2752 }
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763 @Override
2764 public void updateSQLXML( int columnIndex,
2765 SQLXML xmlObject ) throws SQLException {
2766 notClosed();
2767 noUpdates();
2768 }
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779 @Override
2780 public void updateSQLXML( String columnLabel,
2781 SQLXML xmlObject ) throws SQLException {
2782 notClosed();
2783 noUpdates();
2784 }
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795 @Override
2796 public void updateShort( int columnIndex,
2797 short x ) throws SQLException {
2798 notClosed();
2799 noUpdates();
2800 }
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811 @Override
2812 public void updateShort( String columnLabel,
2813 short x ) throws SQLException {
2814 notClosed();
2815 noUpdates();
2816 }
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827 @Override
2828 public void updateString( int columnIndex,
2829 String x ) throws SQLException {
2830 notClosed();
2831 noUpdates();
2832 }
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843 @Override
2844 public void updateString( String columnLabel,
2845 String x ) throws SQLException {
2846 notClosed();
2847 noUpdates();
2848 }
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859 @Override
2860 public void updateTime( int columnIndex,
2861 Time x ) throws SQLException {
2862 notClosed();
2863 noUpdates();
2864 }
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875 @Override
2876 public void updateTime( String columnLabel,
2877 Time x ) throws SQLException {
2878 notClosed();
2879 noUpdates();
2880 }
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891 @Override
2892 public void updateTimestamp( int columnIndex,
2893 Timestamp x ) throws SQLException {
2894 notClosed();
2895 noUpdates();
2896 }
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907 @Override
2908 public void updateTimestamp( String columnLabel,
2909 Timestamp x ) throws SQLException {
2910 notClosed();
2911 noUpdates();
2912 }
2913
2914
2915
2916
2917
2918
2919 @Override
2920 public boolean wasNull() throws SQLException {
2921 notClosed();
2922
2923 return currentValue == null;
2924 }
2925
2926
2927
2928
2929
2930
2931 @Override
2932 public boolean isWrapperFor( Class<?> iface ) {
2933 return iface.isInstance(this);
2934 }
2935
2936
2937
2938
2939
2940
2941 @Override
2942 public <T> T unwrap( Class<T> iface ) throws SQLException {
2943 if (iface.isInstance(this)) {
2944 return iface.cast(this);
2945 }
2946
2947 throw new SQLException(JdbcI18n.classDoesNotImplementInterface.text());
2948 }
2949
2950 }