1 28 29 package com.caucho.amber.query; 30 31 import com.caucho.amber.entity.AmberEntityHome; 32 import com.caucho.amber.entity.Entity; 33 import com.caucho.amber.entity.EntityItem; 34 import com.caucho.amber.expr.AmberExpr; 35 import com.caucho.amber.expr.LoadEntityExpr; 36 import com.caucho.amber.manager.AmberConnection; 37 import com.caucho.util.L10N; 38 39 import java.io.InputStream ; 40 import java.io.Reader ; 41 import java.math.BigDecimal ; 42 import java.net.URL ; 43 import java.sql.*; 44 import java.util.ArrayList ; 45 import java.util.Calendar ; 46 import java.util.Map ; 47 import java.util.logging.Level ; 48 import java.util.logging.Logger ; 49 50 53 public class ResultSetImpl implements ResultSet { 54 private static final Logger log 55 = Logger.getLogger(ResultSetImpl.class.getName()); 56 private static final L10N L = new L10N(ResultSetImpl.class); 57 58 public static final int CACHE_CHUNK_SIZE = 64; 59 60 private UserQuery _userQuery; 61 private ResultSet _rs; 62 private ArrayList <FromItem> _fromList; 63 private ArrayList <AmberExpr> _resultList; 64 private Map <AmberExpr, String > _joinFetchMap; 65 private AmberConnection _session; 66 67 private QueryCacheKey _cacheKey; 68 private ResultSetCacheChunk _cacheChunk; 69 private ResultSetMetaData _cacheMetaData; 70 private boolean _isCache; 71 72 private int _firstResult; 73 private int _maxResults = Integer.MAX_VALUE / 2; 74 private int _row; 75 76 private int _numberOfLoadingColumns = 1; 77 78 public ResultSetImpl() 79 { 80 } 81 82 85 public void setUserQuery(UserQuery userQuery) 86 { 87 _userQuery = userQuery; 88 } 89 90 93 public void setResultSet(ResultSet rs) 94 throws SQLException 95 { 96 _rs = rs; 97 98 if (rs != null) 99 _cacheMetaData = rs.getMetaData(); 100 } 101 102 105 public void setResultSet(ResultSet rs, 106 ResultSetMetaData metaData) 107 { 108 _rs = rs; 109 _cacheMetaData = metaData; 110 } 111 112 115 public void setQuery(SelectQuery query) 116 { 117 _fromList = query.getFromList(); 118 _resultList = query.getResultList(); 119 _joinFetchMap = query.getJoinFetchMap(); 120 } 121 122 125 public void setSession(AmberConnection aConn) 126 { 127 _session = aConn; 128 } 129 130 133 public void setCacheChunk(ResultSetCacheChunk cacheChunk, 134 ResultSetMetaData metaData) 135 { 136 _cacheChunk = cacheChunk; 137 _cacheMetaData = metaData; 138 _isCache = true; 139 } 140 141 144 public void setFirstResult(int first) 145 { 146 _firstResult = first; 147 } 148 149 152 public void setMaxResults(int max) 153 { 154 if (max < 0) 155 _maxResults = Integer.MAX_VALUE / 2; 156 else 157 _maxResults = max; 158 } 159 160 163 public void fillCacheChunk(ResultSetCacheChunk cacheChunk) 164 throws SQLException 165 { 166 int size = CACHE_CHUNK_SIZE; 167 int maxSize = Integer.MAX_VALUE / 2; 168 int i = 0; 169 170 ResultSetCacheChunk tail = cacheChunk; 171 172 for (; maxSize-- > 0; i++) { 174 if (_rs.next()) { 175 if (size <= i) { 176 i = 0; 177 178 ResultSetCacheChunk next = new ResultSetCacheChunk(tail); 179 tail.setNext(next); 180 tail = next; 181 } 182 183 tail.newRow(); 184 185 int len = _resultList.size(); 186 int offset = 0; 187 188 for (int j = 0; j < len; j++) { 189 int index = getColumn(j + 1); 190 191 AmberExpr expr = _resultList.get(j); 192 193 if (expr instanceof LoadEntityExpr) { 194 LoadEntityExpr entityExpr = (LoadEntityExpr) expr; 195 196 Object obj = entityExpr.getCacheObject(_session, 197 _rs, 198 index + offset, 199 _joinFetchMap); 200 201 tail.setValue(i, j, obj); 202 203 offset += entityExpr.getIndex(); 205 } 206 else { 207 Object obj = expr.getCacheObject(_session, 208 _rs, 209 index + offset); 210 211 tail.setValue(i, j, obj); 212 } 213 } 214 } 215 else { 216 tail.setLast(true); 217 return; 218 } 219 } 220 221 226 } 227 228 231 public void init() 232 throws SQLException 233 { 234 _row = 0; 235 _numberOfLoadingColumns = 1; 236 237 while (_row < _firstResult && next()) { 238 } 239 } 240 241 244 public int getRow() 245 throws SQLException 246 { 247 return _rs.getRow(); 248 } 249 250 253 public boolean isBeforeFirst() 254 throws SQLException 255 { 256 return _rs.isBeforeFirst(); 257 } 258 259 262 public boolean isFirst() 263 throws SQLException 264 { 265 return _rs.isFirst(); 266 } 267 268 271 public boolean isLast() 272 throws SQLException 273 { 274 return _rs.isLast(); 275 } 276 277 280 public boolean isAfterLast() 281 throws SQLException 282 { 283 return _rs.isAfterLast(); 284 } 285 286 289 public java.sql.Statement getStatement() 290 throws SQLException 291 { 292 return _rs.getStatement(); 293 } 294 295 298 public java.sql.ResultSetMetaData getMetaData() 299 throws SQLException 300 { 301 try { 302 303 if (_rs == null) 304 return _cacheMetaData; 305 else { 306 _cacheMetaData = _rs.getMetaData(); 307 308 return _cacheMetaData; 309 } 310 311 } catch (NullPointerException ex) { 312 } 313 314 return null; 315 } 316 317 320 public SQLWarning getWarnings() 321 throws SQLException 322 { 323 return _rs.getWarnings(); 324 } 325 326 329 public void clearWarnings() 330 throws SQLException 331 { 332 _rs.clearWarnings(); 333 } 334 335 338 public String getCursorName() 339 throws SQLException 340 { 341 return _rs.getCursorName(); 342 } 343 344 347 public void setFetchSize(int size) 348 throws SQLException 349 { 350 _rs.setFetchSize(size); 351 } 352 353 356 public int getFetchSize() 357 throws SQLException 358 { 359 return _rs.getFetchSize(); 360 } 361 362 365 public int getFetchDirection() 366 throws SQLException 367 { 368 return _rs.getFetchDirection(); 369 } 370 371 374 public void setFetchDirection(int dir) 375 throws SQLException 376 { 377 _rs.setFetchDirection(dir); 378 } 379 380 383 public int getConcurrency() 384 throws SQLException 385 { 386 return _rs.getConcurrency(); 387 } 388 389 392 public boolean next() 393 throws SQLException 394 { 395 if (_firstResult + _maxResults <= _row) 396 return false; 397 398 int row = _row++; 399 ResultSetCacheChunk cacheChunk = _cacheChunk; 400 401 if (cacheChunk == null) 402 return _rs.next(); 403 else if (row < cacheChunk.getRowCount()) { 404 return true; 405 } 406 else { 407 ResultSetCacheChunk next = cacheChunk.getNext(); 408 409 if (next != null) { 410 _cacheChunk = next; 411 return true; 412 } 413 414 _isCache = false; 415 _cacheChunk = null; 416 417 if (cacheChunk.isLast()) { 418 _maxResults = 0; 419 return false; 420 } 421 else if (_rs != null) 422 return true; 423 else if (_userQuery != null) { 424 _rs = _userQuery.executeQuery(row, -1); 425 426 _cacheMetaData = _rs.getMetaData(); 427 428 return _rs.next(); 429 } 430 else { 431 return false; 432 } 433 } 434 } 435 436 439 public boolean previous() 440 throws SQLException 441 { 442 if (_row <= _firstResult) 443 return false; 444 445 _row--; 446 447 return _rs.previous(); 448 } 449 450 453 public boolean relative(int delta) 454 throws SQLException 455 { 456 return _rs.relative(delta); 457 } 458 459 462 public boolean absolute(int delta) 463 throws SQLException 464 { 465 return _rs.absolute(delta); 466 } 467 468 471 public void beforeFirst() 472 throws SQLException 473 { 474 _rs.beforeFirst(); 475 } 476 477 480 public boolean first() 481 throws SQLException 482 { 483 return _rs.first(); 484 } 485 486 489 public boolean last() 490 throws SQLException 491 { 492 return _rs.last(); 493 } 494 495 498 public void afterLast() 499 throws SQLException 500 { 501 _rs.afterLast(); 502 } 503 504 507 public boolean wasNull() 508 throws SQLException 509 { 510 return _rs.wasNull(); 511 } 512 513 516 public int getType() 517 throws SQLException 518 { 519 return _rs.getType(); 520 } 521 522 525 public int findColumn(String columnName) 526 throws SQLException 527 { 528 throw new UnsupportedOperationException (); 529 } 530 531 534 public boolean getBoolean(String columnName) 535 throws SQLException 536 { 537 int column = getColumn(columnName); 538 539 if (_cacheChunk != null) 540 return _cacheChunk.getBoolean(_row - 1, column - 1); 541 else 542 return _rs.getBoolean(column); 543 } 544 545 548 public boolean getBoolean(int column) 549 throws SQLException 550 { 551 if (_cacheChunk != null) 552 return _cacheChunk.getBoolean(_row - 1, column - 1); 553 else 554 return _rs.getBoolean(column); 555 } 556 557 560 public byte getByte(String columnName) 561 throws SQLException 562 { 563 int column = getColumn(columnName); 564 565 if (_cacheChunk != null) 566 return _cacheChunk.getByte(_row - 1, column - 1); 567 else 568 return _rs.getByte(column); 569 } 570 571 574 public byte getByte(int column) 575 throws SQLException 576 { 577 if (_cacheChunk != null) 578 return _cacheChunk.getByte(_row - 1, column - 1); 579 else 580 return _rs.getByte(column); 581 } 582 583 586 public short getShort(String columnName) 587 throws SQLException 588 { 589 int column = getColumn(columnName); 590 591 if (_cacheChunk != null) 592 return _cacheChunk.getShort(_row - 1, column - 1); 593 else 594 return _rs.getShort(column); 595 } 596 597 600 public short getShort(int column) 601 throws SQLException 602 { 603 if (_cacheChunk != null) 604 return _cacheChunk.getShort(_row - 1, column - 1); 605 else 606 return _rs.getShort(column); 607 } 608 609 612 public int getInt(String columnName) 613 throws SQLException 614 { 615 int column = getColumn(columnName); 616 617 if (_cacheChunk != null) 618 return _cacheChunk.getInt(_row - 1, column - 1); 619 else 620 return _rs.getInt(column); 621 } 622 623 626 public int getInt(int column) 627 throws SQLException 628 { 629 if (_cacheChunk != null) 630 return _cacheChunk.getInt(_row - 1, column - 1); 631 else 632 return _rs.getInt(column); 633 } 634 635 638 public long getLong(String columnName) 639 throws SQLException 640 { 641 int column = getColumn(columnName); 642 643 if (_cacheChunk != null) 644 return _cacheChunk.getLong(_row - 1, column - 1); 645 else 646 return _rs.getLong(column); 647 } 648 649 652 public long getLong(int column) 653 throws SQLException 654 { 655 if (_cacheChunk != null) 656 return _cacheChunk.getLong(_row - 1, column - 1); 657 else 658 return _rs.getLong(column); 659 } 660 661 664 public float getFloat(String columnName) 665 throws SQLException 666 { 667 int column = getColumn(columnName); 668 669 if (_cacheChunk != null) 670 return _cacheChunk.getFloat(_row - 1, column - 1); 671 else 672 return _rs.getFloat(column); 673 } 674 675 678 public float getFloat(int column) 679 throws SQLException 680 { 681 if (_cacheChunk != null) 682 return _cacheChunk.getFloat(_row - 1, column - 1); 683 else 684 return _rs.getFloat(column); 685 } 686 687 690 public double getDouble(String columnName) 691 throws SQLException 692 { 693 int column = getColumn(columnName); 694 695 if (_cacheChunk != null) 696 return _cacheChunk.getDouble(_row - 1, column - 1); 697 else 698 return _rs.getDouble(column); 699 } 700 701 704 public double getDouble(int column) 705 throws SQLException 706 { 707 if (_cacheChunk != null) 708 return _cacheChunk.getDouble(_row - 1, column - 1); 709 else 710 return _rs.getDouble(column); 711 } 712 713 716 public String getString(int column) 717 throws SQLException 718 { 719 if (_cacheChunk != null) 720 return _cacheChunk.getString(_row - 1, column - 1); 721 else 722 return _rs.getString(column); 723 } 724 725 728 public String getString(String columnName) 729 throws SQLException 730 { 731 int column = getColumn(columnName); 732 733 if (_cacheChunk != null) 734 return _cacheChunk.getString(_row - 1, column - 1); 735 else 736 return _rs.getString(column); 737 } 738 739 742 public byte []getBytes(int column) 743 throws SQLException 744 { 745 return _rs.getBytes(getColumn(column)); 746 } 747 748 751 public byte []getBytes(String column) 752 throws SQLException 753 { 754 return _rs.getBytes(getColumn(column)); 755 } 756 757 760 public java.sql.Date getDate(int column) 761 throws SQLException 762 { 763 return _rs.getDate(getColumn(column)); 764 } 765 766 769 public java.sql.Date getDate(String column) 770 throws SQLException 771 { 772 return _rs.getDate(getColumn(column)); 773 } 774 775 778 public java.sql.Date getDate(int column, Calendar cal) 779 throws SQLException 780 { 781 return _rs.getDate(getColumn(column), cal); 782 } 783 784 787 public java.sql.Date getDate(String column, Calendar cal) 788 throws SQLException 789 { 790 return _rs.getDate(getColumn(column), cal); 791 } 792 793 796 public Time getTime(int column) 797 throws SQLException 798 { 799 return _rs.getTime(getColumn(column)); 800 } 801 802 805 public Time getTime(String column) 806 throws SQLException 807 { 808 return _rs.getTime(getColumn(column)); 809 } 810 811 814 public Time getTime(int column, Calendar cal) 815 throws SQLException 816 { 817 return _rs.getTime(getColumn(column), cal); 818 } 819 820 823 public Time getTime(String column, Calendar cal) 824 throws SQLException 825 { 826 return _rs.getTime(getColumn(column), cal); 827 } 828 829 832 public Timestamp getTimestamp(int column) 833 throws SQLException 834 { 835 return _rs.getTimestamp(getColumn(column)); 836 } 837 838 841 public Timestamp getTimestamp(String column) 842 throws SQLException 843 { 844 return _rs.getTimestamp(getColumn(column)); 845 } 846 847 850 public Timestamp getTimestamp(int column, Calendar cal) 851 throws SQLException 852 { 853 return _rs.getTimestamp(getColumn(column), cal); 854 } 855 856 859 public Timestamp getTimestamp(String column, Calendar cal) 860 throws SQLException 861 { 862 return _rs.getTimestamp(getColumn(column), cal); 863 } 864 865 868 public Ref getRef(int column) 869 throws SQLException 870 { 871 return _rs.getRef(getColumn(column)); 872 } 873 874 877 public Ref getRef(String column) 878 throws SQLException 879 { 880 return _rs.getRef(getColumn(column)); 881 } 882 883 886 public Clob getClob(int column) 887 throws SQLException 888 { 889 return _rs.getClob(getColumn(column)); 890 } 891 892 895 public Clob getClob(String column) 896 throws SQLException 897 { 898 return _rs.getClob(getColumn(column)); 899 } 900 901 904 public Blob getBlob(int column) 905 throws SQLException 906 { 907 return _rs.getBlob(getColumn(column)); 908 } 909 910 913 public Blob getBlob(String column) 914 throws SQLException 915 { 916 return _rs.getBlob(getColumn(column)); 917 } 918 919 922 public Reader getCharacterStream(int column) 923 throws SQLException 924 { 925 return _rs.getCharacterStream(getColumn(column)); 926 } 927 928 931 public Reader getCharacterStream(String column) 932 throws SQLException 933 { 934 return _rs.getCharacterStream(getColumn(column)); 935 } 936 937 940 public InputStream getBinaryStream(int column) 941 throws SQLException 942 { 943 return _rs.getBinaryStream(getColumn(column)); 944 } 945 946 949 public InputStream getBinaryStream(String column) 950 throws SQLException 951 { 952 return _rs.getBinaryStream(getColumn(column)); 953 } 954 955 958 public InputStream getAsciiStream(int column) 959 throws SQLException 960 { 961 return _rs.getAsciiStream(getColumn(column)); 962 } 963 964 967 public InputStream getAsciiStream(String column) 968 throws SQLException 969 { 970 return _rs.getAsciiStream(getColumn(column)); 971 } 972 973 976 public InputStream getUnicodeStream(int column) 977 throws SQLException 978 { 979 return _rs.getUnicodeStream(getColumn(column)); 980 } 981 982 985 public InputStream getUnicodeStream(String column) 986 throws SQLException 987 { 988 return _rs.getUnicodeStream(getColumn(column)); 989 } 990 991 994 public Array getArray(int column) 995 throws SQLException 996 { 997 return _rs.getArray(getColumn(column)); 998 } 999 1000 1003 public Array getArray(String column) 1004 throws SQLException 1005 { 1006 return _rs.getArray(getColumn(column)); 1007 } 1008 1009 1012 public URL getURL(int column) 1013 throws SQLException 1014 { 1015 return _rs.getURL(getColumn(column)); 1016 } 1017 1018 1021 public URL getURL(String column) 1022 throws SQLException 1023 { 1024 return _rs.getURL(getColumn(column)); 1025 } 1026 1027 1030 public BigDecimal getBigDecimal(int column) 1031 throws SQLException 1032 { 1033 return _rs.getBigDecimal(getColumn(column)); 1034 } 1035 1036 1039 public BigDecimal getBigDecimal(String column) 1040 throws SQLException 1041 { 1042 return _rs.getBigDecimal(getColumn(column)); 1043 } 1044 1045 1048 public BigDecimal getBigDecimal(int column, int digit) 1049 throws SQLException 1050 { 1051 return _rs.getBigDecimal(getColumn(column), digit); 1052 } 1053 1054 1057 public BigDecimal getBigDecimal(String column, int digit) 1058 throws SQLException 1059 { 1060 return _rs.getBigDecimal(getColumn(column), digit); 1061 } 1062 1063 1066 public Object getObject(int column) 1067 throws SQLException 1068 { 1069 ResultSetCacheChunk cacheChunk = _cacheChunk; 1070 1071 if (cacheChunk != null) { 1072 Object obj = cacheChunk.getObject(_row - 1, column - 1); 1073 1074 if (obj instanceof EntityItem) { 1075 EntityItem entityItem = (EntityItem) obj; 1076 1077 Entity entity = entityItem.getEntity(); 1078 1079 Object value = _session.loadProxy(entity.__caucho_getEntityType(), 1080 entity.__caucho_getPrimaryKey()); 1081 1082 _numberOfLoadingColumns = entityItem.getNumberOfLoadingColumns(); 1083 1084 return value; 1085 } 1086 else 1087 return obj; 1088 } 1089 else { 1090 int index = getColumn(column); 1091 1092 AmberExpr expr = _resultList.get(column - 1); 1093 1094 Object value = expr.getObject(_session, _rs, index); 1095 1096 if (expr instanceof LoadEntityExpr) { 1097 LoadEntityExpr entityExpr = (LoadEntityExpr) expr; 1098 _numberOfLoadingColumns = entityExpr.getIndex(); 1099 } 1100 1101 return value; 1102 } 1103 } 1104 1105 1108 public EntityItem findEntityItem(int column) 1109 throws SQLException 1110 { 1111 ResultSetCacheChunk cacheChunk = _cacheChunk; 1112 1113 if (cacheChunk != null) { 1114 Object obj = cacheChunk.getObject(_row - 1, column - 1); 1115 1116 if (obj instanceof EntityItem) { 1117 return (EntityItem) obj; 1118 } 1119 else 1120 throw new SQLException(L.l("'{0}' is an unexpected type.", 1121 obj)); 1122 } 1123 else { 1124 int index = getColumn(column); 1125 1126 AmberExpr expr = _resultList.get(column - 1); 1127 1128 EntityItem item = expr.findItem(_session, _rs, index); 1129 1130 return item; 1131 } 1132 1138 } 1139 1140 1143 public Object getObject(String column) 1144 throws SQLException 1145 { 1146 throw new UnsupportedOperationException (); 1147 } 1148 1149 1152 public Object getKey(int column) 1153 throws SQLException 1154 { 1155 int index = getColumn(column); 1156 1157 FromItem item = _fromList.get(column - 1); 1158 AmberEntityHome home = item.getEntityHome(); 1159 1160 Object key = home.getEntityType().getId().getObject(_rs, index); 1161 1162 return key; 1163 } 1164 1165 1168 public Object getObject(int column, Map <String ,Class <?>> map) 1169 throws SQLException 1170 { 1171 throw new UnsupportedOperationException (); 1172 } 1173 1174 1177 public Object getObject(String column, Map <String ,Class <?>> map) 1178 throws SQLException 1179 { 1180 throw new UnsupportedOperationException (); 1181 } 1182 1183 1186 public void updateString(String column, String value) 1187 throws SQLException 1188 { 1189 throw new UnsupportedOperationException (); 1190 } 1191 1192 1195 public void updateString(int column, String value) 1196 throws SQLException 1197 { 1198 throw new UnsupportedOperationException (); 1199 } 1200 1201 1204 public void updateObject(String column, Object value) 1205 throws SQLException 1206 { 1207 throw new UnsupportedOperationException (); 1208 } 1209 1210 1213 public void updateObject(int column, Object value) 1214 throws SQLException 1215 { 1216 throw new UnsupportedOperationException (); 1217 } 1218 1219 1222 public void updateObject(String column, Object value, int scale) 1223 throws SQLException 1224 { 1225 throw new UnsupportedOperationException (); 1226 } 1227 1228 1231 public void updateObject(int column, Object value, int scale) 1232 throws SQLException 1233 { 1234 throw new UnsupportedOperationException (); 1235 } 1236 1237 1240 public void updateTimestamp(String column, Timestamp timestamp) 1241 throws SQLException 1242 { 1243 throw new UnsupportedOperationException (); 1244 } 1245 1246 1249 public void updateTimestamp(int column, Timestamp timestamp) 1250 throws SQLException 1251 { 1252 throw new UnsupportedOperationException (); 1253 } 1254 1255 1258 public void updateTime(String column, Time time) 1259 throws SQLException 1260 { 1261 throw new UnsupportedOperationException (); 1262 } 1263 1264 1267 public void updateTime(int column, Time time) 1268 throws SQLException 1269 { 1270 throw new UnsupportedOperationException (); 1271 } 1272 1273 1276 public void updateDate(String column, java.sql.Date date) 1277 throws SQLException 1278 { 1279 throw new UnsupportedOperationException (); 1280 } 1281 1282 1285 public void updateDate(int column, java.sql.Date date) 1286 throws SQLException 1287 { 1288 throw new UnsupportedOperationException (); 1289 } 1290 1291 1294 public void updateClob(String column, Clob clob) 1295 throws SQLException 1296 { 1297 throw new UnsupportedOperationException (); 1298 } 1299 1300 1303 public void updateClob(int column, Clob clob) 1304 throws SQLException 1305 { 1306 throw new UnsupportedOperationException (); 1307 } 1308 1309 1312 public void updateBlob(String column, Blob blob) 1313 throws SQLException 1314 { 1315 throw new UnsupportedOperationException (); 1316 } 1317 1318 1321 public void updateBlob(int column, Blob blob) 1322 throws SQLException 1323 { 1324 throw new UnsupportedOperationException (); 1325 } 1326 1327 1330 public void updateArray(String column, Array array) 1331 throws SQLException 1332 { 1333 throw new UnsupportedOperationException (); 1334 } 1335 1336 1339 public void updateArray(int column, Array array) 1340 throws SQLException 1341 { 1342 throw new UnsupportedOperationException (); 1343 } 1344 1345 1348 public void updateBigDecimal(String column, BigDecimal decimal) 1349 throws SQLException 1350 { 1351 throw new UnsupportedOperationException (); 1352 } 1353 1354 1357 public void updateBigDecimal(int column, BigDecimal decimal) 1358 throws SQLException 1359 { 1360 throw new UnsupportedOperationException (); 1361 } 1362 1363 1366 public void updateRef(String column, Ref ref) 1367 throws SQLException 1368 { 1369 throw new UnsupportedOperationException (); 1370 } 1371 1372 1375 public void updateRef(int column, Ref ref) 1376 throws SQLException 1377 { 1378 throw new UnsupportedOperationException (); 1379 } 1380 1381 1384 public void updateCharacterStream(String column, Reader x, int length) 1385 throws SQLException 1386 { 1387 throw new UnsupportedOperationException (); 1388 } 1389 1390 1393 public void updateCharacterStream(int column, Reader x, int length) 1394 throws SQLException 1395 { 1396 throw new UnsupportedOperationException (); 1397 } 1398 1399 1402 public void updateBinaryStream(String column, InputStream x, int length) 1403 throws SQLException 1404 { 1405 throw new UnsupportedOperationException (); 1406 } 1407 1408 1411 public void updateBinaryStream(int column, InputStream x, int length) 1412 throws SQLException 1413 { 1414 throw new UnsupportedOperationException (); 1415 } 1416 1417 1420 public void updateAsciiStream(String column, InputStream x, int length) 1421 throws SQLException 1422 { 1423 throw new UnsupportedOperationException (); 1424 } 1425 1426 1429 public void updateAsciiStream(int column, InputStream x, int length) 1430 throws SQLException 1431 { 1432 throw new UnsupportedOperationException (); 1433 } 1434 1435 1438 public void updateUnicodeStream(String column, InputStream x, int length) 1439 throws SQLException 1440 { 1441 throw new UnsupportedOperationException (); 1442 } 1443 1444 1447 public void updateUnicodeStream(int column, InputStream x, int length) 1448 throws SQLException 1449 { 1450 throw new UnsupportedOperationException (); 1451 } 1452 1453 1456 public void updateBytes(String column, byte []value) 1457 throws SQLException 1458 { 1459 throw new UnsupportedOperationException (); 1460 } 1461 1462 1465 public void updateBytes(int column, byte []value) 1466 throws SQLException 1467 { 1468 throw new UnsupportedOperationException (); 1469 } 1470 1471 1474 public void updateBoolean(String column, boolean value) 1475 throws SQLException 1476 { 1477 throw new UnsupportedOperationException (); 1478 } 1479 1480 1483 public void updateBoolean(int column, boolean value) 1484 throws SQLException 1485 { 1486 throw new UnsupportedOperationException (); 1487 } 1488 1489 1492 public void updateByte(String column, byte value) 1493 throws SQLException 1494 { 1495 throw new UnsupportedOperationException (); 1496 } 1497 1498 1501 public void updateByte(int column, byte value) 1502 throws SQLException 1503 { 1504 throw new UnsupportedOperationException (); 1505 } 1506 1507 1510 public void updateShort(String column, short value) 1511 throws SQLException 1512 { 1513 throw new UnsupportedOperationException (); 1514 } 1515 1516 1519 public void updateShort(int column, short value) 1520 throws SQLException 1521 { 1522 throw new UnsupportedOperationException (); 1523 } 1524 1525 1528 public void updateInt(String column, int value) 1529 throws SQLException 1530 { 1531 throw new UnsupportedOperationException (); 1532 } 1533 1534 1537 public void updateInt(int column, int value) 1538 throws SQLException 1539 { 1540 throw new UnsupportedOperationException (); 1541 } 1542 1543 1546 public void updateLong(String column, long value) 1547 throws SQLException 1548 { 1549 throw new UnsupportedOperationException (); 1550 } 1551 1552 1555 public void updateLong(int column, long value) 1556 throws SQLException 1557 { 1558 throw new UnsupportedOperationException (); 1559 } 1560 1561 1564 public void updateFloat(String column, float value) 1565 throws SQLException 1566 { 1567 throw new UnsupportedOperationException (); 1568 } 1569 1570 1573 public void updateFloat(int column, float value) 1574 throws SQLException 1575 { 1576 throw new UnsupportedOperationException (); 1577 } 1578 1579 1582 public void updateDouble(String column, double value) 1583 throws SQLException 1584 { 1585 throw new UnsupportedOperationException (); 1586 } 1587 1588 1591 public void updateDouble(int column, double value) 1592 throws SQLException 1593 { 1594 throw new UnsupportedOperationException (); 1595 } 1596 1597 1600 public void updateNull(String column) 1601 throws SQLException 1602 { 1603 throw new UnsupportedOperationException (); 1604 } 1605 1606 1609 public void updateNull(int column) 1610 throws SQLException 1611 { 1612 throw new UnsupportedOperationException (); 1613 } 1614 1615 1618 public void updateRow() 1619 throws SQLException 1620 { 1621 throw new UnsupportedOperationException (); 1622 } 1623 1624 1627 public void cancelRowUpdates() 1628 throws SQLException 1629 { 1630 throw new UnsupportedOperationException (); 1631 } 1632 1633 1636 public void refreshRow() 1637 throws SQLException 1638 { 1639 throw new UnsupportedOperationException (); 1640 } 1641 1642 1645 public void moveToCurrentRow() 1646 throws SQLException 1647 { 1648 throw new UnsupportedOperationException (); 1649 } 1650 1651 1654 public boolean rowUpdated() 1655 throws SQLException 1656 { 1657 throw new UnsupportedOperationException (); 1658 } 1659 1660 1663 public boolean rowInserted() 1664 throws SQLException 1665 { 1666 throw new UnsupportedOperationException (); 1667 } 1668 1669 1672 public void moveToInsertRow() 1673 throws SQLException 1674 { 1675 throw new UnsupportedOperationException (); 1676 } 1677 1678 1681 public void insertRow() 1682 throws SQLException 1683 { 1684 throw new UnsupportedOperationException (); 1685 } 1686 1687 1690 public boolean rowDeleted() 1691 throws SQLException 1692 { 1693 throw new UnsupportedOperationException (); 1694 } 1695 1696 1699 public void deleteRow() 1700 throws SQLException 1701 { 1702 throw new UnsupportedOperationException (); 1703 } 1704 1705 public int getNumberOfLoadingColumns() 1706 { 1707 return _numberOfLoadingColumns; 1708 } 1709 1710 private int getColumn(String name) 1711 { 1712 throw new UnsupportedOperationException (); 1713 } 1714 1715 private int getColumn(int index) 1716 { 1717 return index; 1718 } 1719 1720 public void close() 1721 { 1722 ResultSet rs = _rs; 1723 _rs = null; 1724 1725 if (rs != null) { 1726 try { 1727 rs.close(); 1728 } catch (SQLException e) { 1729 log.log(Level.FINE, e.toString(), e); 1730 } 1731 } 1732 } 1733} 1734 | Popular Tags |