1 19 20 package org.relique.jdbc.csv; 21 22 import java.io.ByteArrayInputStream ; 23 import java.io.IOException ; 24 import java.io.InputStream ; 25 import java.io.Reader ; 26 import java.io.StringReader ; 27 import java.math.BigDecimal ; 28 import java.net.URL ; 29 import java.sql.*; 30 import java.util.Calendar ; 31 import java.util.Map ; 32 33 38 public class CsvResultSet implements ResultSet { 39 40 41 protected ResultSetMetaData resultSetMetaData; 42 43 44 protected Statement statement; 45 46 47 protected CsvReader reader; 48 49 50 protected String tableName; 51 52 53 protected String [] columnNames; 54 55 protected Map columnTypes; 56 protected String [] whereColumnNames; 57 58 protected String [] whereColumnValues; 59 60 61 62 protected int lastIndexRead = -1; 63 64 65 protected InputStream is; 66 67 75 87 95 protected CsvResultSet(Statement statement, 96 CsvReader reader, 97 String tableName, 98 String [] columnNames, 99 String [] columnWhereNames, 100 String [] columnWhereValues, 101 Map columnTypes) { 102 this.statement = statement; 103 this.reader = reader; 104 this.tableName = tableName; 105 this.columnNames = columnNames; 106 this.whereColumnNames = columnWhereNames; 107 this.whereColumnValues = columnWhereValues; 108 this.columnTypes = columnTypes; 109 if(columnNames[0].equals("*")) { 110 this.columnNames = reader.getColumnNames(); 111 } 112 } 113 114 130 public boolean next() throws SQLException { 131 mainLoop: 132 while(reader.next()) { 133 boolean isRow = true; 134 out: 135 for (int i = 0; i < this.whereColumnNames.length; i++) { 136 if ( !( Utils.compareValues( reader.getColumn(this.whereColumnNames[i]), this.whereColumnValues[i]) ) ) { 140 isRow = false; 141 break out; 142 } 143 144 } 149 if (isRow == true) 150 return true; 151 } 152 return false; 153 } 154 155 170 public void close() throws SQLException { 171 reader.close(); 172 } 173 174 186 public boolean wasNull() throws SQLException { 187 if(lastIndexRead >= 0) { 188 return getString(lastIndexRead) == null; 189 } else { 190 throw new SQLException("No previous getter method called"); 191 } 192 } 193 194 198 208 public String getString(int columnIndex) throws SQLException { 209 preAccessor(columnIndex); 211 if (columnIndex < 1 || columnIndex > columnNames.length) { 213 throw new SQLException("Column not found: invalid index: "+columnIndex); 214 } 215 String retValue = reader.getColumn(columnNames[columnIndex-1]); 216 return retValue; 219 } 220 221 231 public boolean getBoolean(int columnIndex) throws SQLException { 232 String str = getString(columnIndex); 233 return (str == null) ? false : Boolean.valueOf(str).booleanValue(); 234 } 235 236 246 public byte getByte(int columnIndex) throws SQLException { 247 String str = getString(columnIndex); 248 return (str == null) ? 0 : Byte.parseByte(str); 249 } 250 251 261 public short getShort(int columnIndex) throws SQLException { 262 String str = getString(columnIndex); 263 return (str == null) ? 0 : Short.parseShort(str); 264 } 265 266 276 public int getInt(int columnIndex) throws SQLException { 277 String str = getString(columnIndex); 278 return (str == null) ? 0 : Integer.parseInt(str); 279 } 280 281 291 public long getLong(int columnIndex) throws SQLException { 292 String str = getString(columnIndex); 293 return (str == null) ? 0L : Long.parseLong(str); 294 } 295 296 306 public float getFloat(int columnIndex) throws SQLException { 307 String str = getString(columnIndex); 308 return (str == null) ? 0F : Float.parseFloat(str); 309 } 310 311 321 public double getDouble(int columnIndex) throws SQLException { 322 String str = getString(columnIndex); 323 return (str == null) ? 0D : Double.parseDouble(str); 324 } 325 326 338 public BigDecimal getBigDecimal(int columnIndex, int scale) 339 throws SQLException { 340 return getBigDecimal(columnIndex); 342 } 343 344 355 public byte[] getBytes(int columnIndex) throws SQLException { 356 String str = getString(columnIndex); 357 return (str == null || str.equals("")) ? null : Utils.hexStringToBytes(str); 358 } 359 360 370 public Date getDate(int columnIndex) throws SQLException { 371 String str = getString(columnIndex); 372 return (str == null) ? null : Date.valueOf(str); 373 } 374 375 385 public Time getTime(int columnIndex) throws SQLException { 386 String str = getString(columnIndex); 387 return (str == null) ? null : Time.valueOf(str); 388 } 389 390 400 public Timestamp getTimestamp(int columnIndex) throws SQLException { 401 String str = getString(columnIndex); 402 return (str == null) ? null : Timestamp.valueOf(str); 403 } 404 405 427 public InputStream getAsciiStream(int columnIndex) throws SQLException { 428 String str = getString(columnIndex); 429 is = new ByteArrayInputStream (str.getBytes()); 430 return (str == null) ? null : is; 431 } 432 433 462 public InputStream getUnicodeStream(int columnIndex) throws SQLException { 463 return getAsciiStream(columnIndex); 465 } 466 467 488 public InputStream getBinaryStream(int columnIndex) throws SQLException { 489 return getAsciiStream(columnIndex); 491 } 492 493 497 507 public String getString(String columnName) throws SQLException { 508 preAccessor(columnName); 510 String retValue = reader.getColumn(columnName); 512 return retValue; 515 } 516 517 527 public boolean getBoolean(String columnName) throws SQLException { 528 String str = getString(columnName); 529 return (str == null) ? false : Boolean.valueOf(str).booleanValue(); 530 } 531 532 542 public byte getByte(String columnName) throws SQLException { 543 String str = getString(columnName); 544 return (str == null) ? 0 : Byte.parseByte(str); 545 } 546 547 557 public short getShort(String columnName) throws SQLException { 558 String str = getString(columnName); 559 return (str == null) ? 0 : Short.parseShort(str); 560 } 561 562 572 public int getInt(String columnName) throws SQLException { 573 String str = getString(columnName); 574 return (str == null) ? 0 : Integer.parseInt(str); 575 } 576 577 587 public long getLong(String columnName) throws SQLException { 588 String str = getString(columnName); 589 return (str == null) ? 0L : Long.parseLong(str); 590 } 591 592 602 public float getFloat(String columnName) throws SQLException { 603 String str = getString(columnName); 604 return (str == null) ? 0F : Float.parseFloat(str); 605 } 606 607 617 public double getDouble(String columnName) throws SQLException { 618 String str = getString(columnName); 619 return (str == null) ? 0D : Double.parseDouble(str); 620 } 621 622 634 public BigDecimal getBigDecimal(String columnName, int scale) 635 throws SQLException { 636 return getBigDecimal(columnName); 638 } 639 640 651 public byte[] getBytes(String columnName) throws SQLException { 652 String str = getString(columnName); 653 return (str == null) ? null : Utils.hexStringToBytes(str); 654 } 655 656 666 public Date getDate(String columnName) throws SQLException { 667 String str = getString(columnName); 668 return (str == null) ? null : Date.valueOf(str); 669 } 670 671 682 public Time getTime(String columnName) throws SQLException { 683 String str = getString(columnName); 684 return (str == null) ? null : Time.valueOf(str); 685 } 686 687 697 public Timestamp getTimestamp(String columnName) throws SQLException { 698 String str = getString(columnName); 699 return (str == null) ? null : Timestamp.valueOf(str); 700 } 701 702 724 public InputStream getAsciiStream(String columnName) throws SQLException { 725 String str = getString(columnName); 726 is = new ByteArrayInputStream (str.getBytes()); 727 return (str == null) ? null : is; 728 } 729 730 757 public InputStream getUnicodeStream(String columnName) throws SQLException { 758 return getAsciiStream(columnName); 760 } 761 762 783 public InputStream getBinaryStream(String columnName) throws SQLException { 784 return getAsciiStream(columnName); 786 } 787 788 792 815 public SQLWarning getWarnings() throws SQLException { 816 throw new UnsupportedOperationException ( 817 "ResultSet.getWarnings() unsupported"); 818 } 819 820 828 public void clearWarnings() throws SQLException { 829 throw new UnsupportedOperationException ( 830 "ResultSet.clearWarnings() unsupported"); 831 } 832 833 856 public String getCursorName() throws SQLException { 857 throw new UnsupportedOperationException ( 858 "ResultSet.getCursorName() unsupported"); 859 } 860 861 868 public ResultSetMetaData getMetaData() throws SQLException { 869 if (resultSetMetaData == null) { 870 resultSetMetaData = new CsvResultSetMetaData(tableName,columnNames,columnTypes); 871 } 872 return resultSetMetaData; 873 } 874 875 901 public Object getObject(int columnIndex) throws SQLException { 902 return getString(columnIndex); 905 } 906 932 public Object getObject(String columnName) throws SQLException { 933 return getString(columnName); 934 } 935 936 945 public int findColumn(String columnName) throws SQLException { 946 int index = -1; 947 for(int i = 0; i < this.columnNames.length; i++) { 948 if(this.columnNames[i].equalsIgnoreCase(columnName)) { 949 index = i+1; 950 break; 951 } 952 } 953 if(index == -1) 954 throw new SQLException("Column "+columnName+" does not exist in result set!"); 955 return index; 956 } 957 958 960 964 975 public Reader getCharacterStream(int columnIndex) throws SQLException { 976 String str = getString(columnIndex); 977 return (str == null) ? null : new StringReader (str); 978 } 979 980 991 public Reader getCharacterStream(String columnName) throws SQLException { 992 String str = getString(columnName); 993 return (str == null) ? null : new StringReader (str); 994 } 995 996 1007 public BigDecimal getBigDecimal(int columnIndex) throws SQLException { 1008 BigDecimal retval = null; 1009 String str = getString(columnIndex); 1010 if(str != null) { 1011 try { 1012 retval = new BigDecimal (str); 1013 } 1014 catch (NumberFormatException e) { 1015 throw new SQLException("Could not convert '" + str + "' to " + 1016 "a java.math.BigDecimal object"); 1017 } 1018 } 1019 return retval; 1020 } 1021 1022 1033 public BigDecimal getBigDecimal(String columnName) throws SQLException { 1034 BigDecimal retval = null; 1035 String str = getString(columnName); 1036 if(str != null) { 1037 try { 1038 retval = new BigDecimal (str); 1039 } 1040 catch (NumberFormatException e) { 1041 throw new SQLException("Could not convert '" + str + "' to " + 1042 "a java.math.BigDecimal object"); 1043 } 1044 } 1045 return retval; 1046 } 1047 1048 1052 1061 public boolean isBeforeFirst() throws SQLException { 1062 throw new UnsupportedOperationException ( 1063 "ResultSet.isBeforeFirst() unsupported"); 1064 } 1065 1066 1075 public boolean isAfterLast() throws SQLException { 1076 throw new UnsupportedOperationException ( 1077 "ResultSet.isAfterLast() unsupported"); 1078 } 1079 1080 1088 public boolean isFirst() throws SQLException { 1089 throw new UnsupportedOperationException ( 1090 "ResultSet.isFirst() unsupported"); 1091 } 1092 1093 1105 public boolean isLast() throws SQLException { 1106 throw new UnsupportedOperationException ( 1107 "ResultSet.isLast() unsupported"); 1108 } 1109 1110 1118 public void beforeFirst() throws SQLException { 1119 throw new UnsupportedOperationException ( 1120 "ResultSet.beforeFirst() unsupported"); 1121 } 1122 1123 1130 public void afterLast() throws SQLException { 1131 throw new UnsupportedOperationException ( 1132 "ResultSet.afterLast() unsupported"); 1133 } 1134 1135 1144 public boolean first() throws SQLException { 1145 throw new UnsupportedOperationException ( 1146 "ResultSet.first() unsupported"); 1147 } 1148 1149 1158 public boolean last() throws SQLException { 1159 throw new UnsupportedOperationException ("ResultSet.last() unsupported"); 1160 } 1161 1162 1169 public int getRow() throws SQLException { 1170 throw new UnsupportedOperationException ( 1171 "ResultSet.getRow() unsupported"); 1172 } 1173 1174 1207 public boolean absolute(int row) throws SQLException { 1208 throw new UnsupportedOperationException ( 1209 "ResultSet.absolute() unsupported"); 1210 } 1211 1212 1233 public boolean relative(int rows) throws SQLException { 1234 throw new UnsupportedOperationException ( 1235 "ResultSet.relative() unsupported"); 1236 } 1237 1238 1247 public boolean previous() throws SQLException { 1248 throw new UnsupportedOperationException ( 1249 "ResultSet.previous() unsupported"); 1250 } 1251 1252 1256 1271 public void setFetchDirection(int direction) throws SQLException { 1272 throw new UnsupportedOperationException ( 1273 "ResultSet.setFetchDirection(int) unsupported"); 1274 } 1275 1276 1285 public int getFetchDirection() throws SQLException { 1286 throw new UnsupportedOperationException ( 1287 "ResultSet.getFetchDirection() unsupported"); 1288 } 1289 1290 1303 public void setFetchSize(int rows) throws SQLException { 1304 throw new UnsupportedOperationException ( 1305 "ResultSet.setFetchSize(int) unsupported"); 1306 } 1307 1308 1316 public int getFetchSize() throws SQLException { 1317 throw new UnsupportedOperationException ( 1318 "ResultSet.getFetchSize() unsupported"); 1319 } 1320 1321 1331 public int getType() throws SQLException { 1332 throw new UnsupportedOperationException ( 1333 "ResultSet.getType() unsupported"); 1334 } 1335 1336 1346 public int getConcurrency() throws SQLException { 1347 return CONCUR_READ_ONLY; 1348 } 1349 1350 1354 1363 public boolean rowUpdated() throws SQLException { 1364 throw new UnsupportedOperationException ( 1365 "ResultSet.rowUpdated() unsupported"); 1366 } 1367 1368 1379 public boolean rowInserted() throws SQLException { 1380 throw new UnsupportedOperationException ( 1381 "ResultSet.rowInserted() unsupported"); 1382 } 1383 1384 1396 public boolean rowDeleted() throws SQLException { 1397 throw new UnsupportedOperationException ( 1398 "ResultSet.rowDeleted() unsupported"); 1399 } 1400 1401 1412 public void updateNull(int columnIndex) throws SQLException { 1413 throw new UnsupportedOperationException ( 1414 "ResultSet.updateNull() unsupported"); 1415 } 1416 1417 1428 public void updateBoolean(int columnIndex, boolean x) throws SQLException { 1429 throw new UnsupportedOperationException ( 1430 "ResultSet.updateBoolean() unsupported"); 1431 } 1432 1433 1445 public void updateByte(int columnIndex, byte x) throws SQLException { 1446 throw new UnsupportedOperationException ( 1447 "ResultSet.updateByte() unsupported"); 1448 } 1449 1450 1461 public void updateShort(int columnIndex, short x) throws SQLException { 1462 throw new UnsupportedOperationException ( 1463 "ResultSet.updateShort() unsupported"); 1464 } 1465 1466 1477 public void updateInt(int columnIndex, int x) throws SQLException { 1478 throw new UnsupportedOperationException ( 1479 "ResultSet.updateInt() unsupported"); 1480 } 1481 1482 1493 public void updateLong(int columnIndex, long x) throws SQLException { 1494 throw new UnsupportedOperationException ( 1495 "ResultSet.updateLong(int, long) unsupported"); 1496 } 1497 1498 1509 public void updateFloat(int columnIndex, float x) throws SQLException { 1510 throw new UnsupportedOperationException ( 1511 "ResultSet.updateFloat(int, float) unsupported"); 1512 } 1513 1514 1525 public void updateDouble(int columnIndex, double x) throws SQLException { 1526 throw new UnsupportedOperationException ( 1527 "ResultSet.updateDouble(int, double) unsupported"); 1528 } 1529 1530 1542 public void updateBigDecimal(int columnIndex, BigDecimal x) 1543 throws SQLException { 1544 throw new UnsupportedOperationException ( 1545 "ResultSet.updateBigDecimal(int, BigDecimal) unsupported"); 1546 } 1547 1548 1559 public void updateString(int columnIndex, String x) throws SQLException { 1560 throw new UnsupportedOperationException ( 1561 "ResultSet.updateString(int, String) unsupported"); 1562 } 1563 1564 1575 public void updateBytes(int columnIndex, byte[] x) throws SQLException { 1576 throw new UnsupportedOperationException ( 1577 "ResultSet.updateBytes(int, byte[]) unsupported"); 1578 } 1579 1580 1591 public void updateDate(int columnIndex, Date x) throws SQLException { 1592 throw new UnsupportedOperationException ( 1593 "ResultSet.updateDate(int, Date) unsupported"); 1594 } 1595 1596 1607 public void updateTime(int columnIndex, Time x) throws SQLException { 1608 throw new UnsupportedOperationException ( 1609 "ResultSet.updateTime(int, Time) unsupported"); 1610 } 1611 1612 1624 public void updateTimestamp(int columnIndex, Timestamp x) 1625 throws SQLException { 1626 throw new UnsupportedOperationException ( 1627 "ResultSet.updateTimestamp(int, Timestamp) unsupported"); 1628 } 1629 1630 1642 public void updateAsciiStream(int columnIndex, InputStream x, int length) 1643 throws SQLException { 1644 throw new UnsupportedOperationException ("ResultSet.updateAsciiStream " + 1645 "(int, InputStream, int) unsupported"); 1646 } 1647 1648 1660 public void updateBinaryStream(int columnIndex, InputStream x, int length) 1661 throws SQLException { 1662 throw new UnsupportedOperationException ("ResultSet.updateBinaryStream" + 1663 "(int, InputStream, int) unsupported"); 1664 } 1665 1666 1678 public void updateCharacterStream(int columnIndex, Reader x, int length) 1679 throws SQLException { 1680 throw new UnsupportedOperationException ("ResultSet.updateCharacterStr" + 1681 "eam(int, Reader, int) unsupported"); 1682 } 1683 1684 1699 public void updateObject(int columnIndex, Object x, int scale) 1700 throws SQLException { 1701 throw new UnsupportedOperationException ( 1702 "ResultSet.udpateObject(int, Object) unsupported"); 1703 } 1704 1705 1716 public void updateObject(int columnIndex, Object x) throws SQLException { 1717 throw new UnsupportedOperationException ( 1718 "ResultSet.updateObject(int, Object, int) unsupported"); 1719 } 1720 1721 1731 public void updateNull(String columnName) throws SQLException { 1732 throw new UnsupportedOperationException ( 1733 "ResultSet.updateNull(String) unsupported"); 1734 } 1735 1736 1747 public void updateBoolean(String columnName, boolean x) 1748 throws SQLException { 1749 throw new UnsupportedOperationException ( 1750 "ResultSet.updateBoolean(String, boolean) unsupported"); 1751 } 1752 1753 1764 public void updateByte(String columnName, byte x) throws SQLException { 1765 throw new UnsupportedOperationException ( 1766 "ResultSet.updateByte(String, byte) unsupported"); 1767 } 1768 1769 1780 public void updateShort(String columnName, short x) throws SQLException { 1781 throw new UnsupportedOperationException ( 1782 "ResultSet.updateShort(String, short) unsupported"); 1783 } 1784 1785 1796 public void updateInt(String columnName, int x) throws SQLException { 1797 throw new UnsupportedOperationException ( 1798 "ResultSet.updateInt(String, int) unsupported"); 1799 } 1800 1801 1812 public void updateLong(String columnName, long x) throws SQLException { 1813 throw new UnsupportedOperationException ( 1814 "ResultSet.updateLong(String, long) unsupported"); 1815 } 1816 1817 1828 public void updateFloat(String columnName, float x) throws SQLException { 1829 throw new UnsupportedOperationException ( 1830 "ResultSet.updateFloat(String, float) unsupported"); 1831 } 1832 1833 1844 public void updateDouble(String columnName, double x) throws SQLException { 1845 throw new UnsupportedOperationException ( 1846 "ResultSet.updateDouble(String, double) unsupported"); 1847 } 1848 1849 1861 public void updateBigDecimal(String columnName, BigDecimal x) 1862 throws SQLException { 1863 throw new UnsupportedOperationException ( 1864 "ResultSet.updateBigDecimal(String, BigDecimal) unsupported"); 1865 } 1866 1867 1878 public void updateString(String columnName, String x) throws SQLException { 1879 throw new UnsupportedOperationException ( 1880 "ResultSet.updateString(String, String) unsupported"); 1881 } 1882 1883 1895 public void updateBytes(String columnName, byte[] x) throws SQLException { 1896 throw new UnsupportedOperationException ( 1897 "ResultSet.updateBytes(String, byte[]) unsupported"); 1898 } 1899 1900 1911 public void updateDate(String columnName, Date x) throws SQLException { 1912 throw new UnsupportedOperationException ( 1913 "ResultSet.updateDate(String, Date) unsupported"); 1914 } 1915 1916 1927 public void updateTime(String columnName, Time x) throws SQLException { 1928 throw new UnsupportedOperationException ( 1929 "ResultSet.updateTime(String, Time) unsupported"); 1930 } 1931 1932 1944 public void updateTimestamp(String columnName, Timestamp x) 1945 throws SQLException { 1946 throw new UnsupportedOperationException ( 1947 "ResultSet.updateTimestamp(String, Timestamp) unsupported"); 1948 } 1949 1950 1962 public void updateAsciiStream(String columnName, InputStream x, int length) 1963 throws SQLException { 1964 throw new UnsupportedOperationException ("ResultSet.updateAsciiStream" + 1965 "(String, InputStream, int) unsupported"); 1966 } 1967 1968 1980 public void updateBinaryStream(String columnName, InputStream x, int length) 1981 throws SQLException { 1982 throw new UnsupportedOperationException ("ResultSet.updateBinaryStream" + 1983 "(String, InputStream, int) unsupported"); 1984 } 1985 1986 1999 public void updateCharacterStream(String columnName, Reader reader, 2000 int length) throws SQLException { 2001 throw new UnsupportedOperationException ("ResultSet.updateCharacterStr" + 2002 "eam(String, Reader, int) unsupported"); 2003 } 2004 2005 2020 public void updateObject(String columnName, Object x, int scale) 2021 throws SQLException { 2022 throw new UnsupportedOperationException ( 2023 "ResultSet.updateObject(String, Object, int) unsupported"); 2024 } 2025 2026 2037 public void updateObject(String columnName, Object x) throws SQLException { 2038 throw new UnsupportedOperationException ( 2039 "ResultSet.updateObject(String, Object) unsupported"); 2040 } 2041 2042 2052 public void insertRow() throws SQLException { 2053 throw new UnsupportedOperationException ( 2054 "ResultSet.insertRow() unsupported"); 2055 } 2056 2057 2065 public void updateRow() throws SQLException { 2066 throw new UnsupportedOperationException ( 2067 "ResultSet.updateRow() unsupported"); 2068 } 2069 2070 2078 public void deleteRow() throws SQLException { 2079 throw new UnsupportedOperationException ( 2080 "ResultSet.deleteRow() unsupported"); 2081 } 2082 2083 2107 public void refreshRow() throws SQLException { 2108 throw new UnsupportedOperationException ( 2109 "ResultSet.refreshRow() unsupported"); 2110 } 2111 2112 2126 public void cancelRowUpdates() throws SQLException { 2127 throw new UnsupportedOperationException ( 2128 "ResultSet.cancelRowUpdates() unsupported"); 2129 } 2130 2131 2151 public void moveToInsertRow() throws SQLException { 2152 throw new UnsupportedOperationException ( 2153 "ResultSet.moveToInsertRow() unsupported"); 2154 } 2155 2156 2164 public void moveToCurrentRow() throws SQLException { 2165 throw new UnsupportedOperationException ( 2166 "ResultSet.moveToeCurrentRow() unsupported"); 2167 } 2168 2169 2181 public Statement getStatement() throws SQLException { 2182 return statement; 2183 } 2184 2185 2202 public Object getObject(int i, Map map) throws SQLException { 2203 throw new UnsupportedOperationException ( 2204 "ResultSet.getObject(int, Map) unsupported"); 2205 } 2206 2207 2217 public Ref getRef(int i) throws SQLException { 2218 throw new UnsupportedOperationException ( 2219 "ResultSet.getRef(int) unsupported"); 2220 } 2221 2222 2232 public Blob getBlob(int i) throws SQLException { 2233 throw new UnsupportedOperationException ( 2234 "ResultSet.getBlob(int) unsupported"); 2235 } 2236 2237 2247 public Clob getClob(int i) throws SQLException { 2248 throw new UnsupportedOperationException ( 2249 "ResultSet.getClob(int) unsupported"); 2250 } 2251 2252 2262 public Array getArray(int i) throws SQLException { 2263 throw new UnsupportedOperationException ( 2264 "ResultSet.getArray(int) unsupported"); 2265 } 2266 2267 2283 public Object getObject(String colName, Map map) throws SQLException { 2284 throw new UnsupportedOperationException ( 2285 "ResultSet.getObject(String, Map) unsupported"); 2286 } 2287 2288 2298 public Ref getRef(String colName) throws SQLException { 2299 throw new UnsupportedOperationException ( 2300 "ResultSet.getRef(String) unsupported"); 2301 } 2302 2303 2313 public Blob getBlob(String colName) throws SQLException { 2314 throw new UnsupportedOperationException ( 2315 "ResultSet.getBlob(String) unsupported"); 2316 } 2317 2318 2328 public Clob getClob(String colName) throws SQLException { 2329 throw new UnsupportedOperationException ( 2330 "ResultSet.getClob(String) unsupported"); 2331 } 2332 2333 2343 public Array getArray(String colName) throws SQLException { 2344 throw new UnsupportedOperationException ( 2345 "ResultSet.getArray(String) unsupported"); 2346 } 2347 2348 2364 public Date getDate(int columnIndex, Calendar cal) throws SQLException { 2365 throw new UnsupportedOperationException ( 2366 "ResultSet.getDate(int, Calendar) unsupported"); 2367 } 2368 2369 2386 public Date getDate(String columnName, Calendar cal) throws SQLException { 2387 throw new UnsupportedOperationException ( 2388 "ResultSet.getDate(String, Calendar) unsupported"); 2389 } 2390 2391 2407 public Time getTime(int columnIndex, Calendar cal) throws SQLException { 2408 throw new UnsupportedOperationException ( 2409 "ResultSet.getTime(int, Calendar) unsupported"); 2410 } 2411 2412 2428 public Time getTime(String columnName, Calendar cal) throws SQLException { 2429 throw new UnsupportedOperationException ( 2430 "ResultSet.getTime(String, Calendar) unsupported"); 2431 } 2432 2433 2449 public Timestamp getTimestamp(int columnIndex, Calendar cal) 2450 throws SQLException { 2451 throw new UnsupportedOperationException ( 2452 "ResultSet.getTimestamp(int, Calendar) unsupported"); 2453 } 2454 2455 2471 public Timestamp getTimestamp(String columnName, Calendar cal) 2472 throws SQLException { 2473 throw new UnsupportedOperationException ( 2474 "ResultSet.getTimestamp(String, Calendar) unsupported"); 2475 } 2476 2477 2481 2486 private void preAccessor(int columnIndex) throws SQLException { 2487 lastIndexRead = columnIndex; 2489 if(is != null) { 2491 try { 2492 is.close(); 2493 } catch (IOException e) { 2494 throw new SQLException("Could not close InputStream: " + e); 2495 } 2496 is = null; 2497 } 2498 } 2499 2500 2505 private void preAccessor(String columnName) throws SQLException { 2506 for (int i = 0; i < columnNames.length; i++) { 2508 if (columnName.equalsIgnoreCase(columnNames[i])) { 2509 preAccessor(i+1); 2510 } 2511 } 2512 } 2513 2514 2518 public URL getURL(int columnIndex) throws SQLException { 2519 throw new UnsupportedOperationException ("ResultSet.getURL(int) unsupported"); 2520 } 2521 2522 public URL getURL(String columnName) throws SQLException { 2523 throw new UnsupportedOperationException ("ResultSet.getURL(String) unsupported"); 2524 } 2525 2526 public void updateRef(int columnIndex, Ref x) throws SQLException { 2527 throw new UnsupportedOperationException ("ResultSet.updateRef(int,java.sql.Ref) unsupported"); 2528 } 2529 2530 public void updateRef(String columnName, Ref x) throws SQLException { 2531 throw new UnsupportedOperationException ("ResultSet.updateRef(String,java.sql.Ref) unsupported"); 2532 } 2533 2534 public void updateBlob(int columnIndex, Blob x) throws SQLException { 2535 throw new UnsupportedOperationException ("ResultSet.updateBlob(int,java.sql.Blob) unsupported"); 2536 } 2537 2538 public void updateBlob(String columnName, Blob x) throws SQLException { 2539 throw new UnsupportedOperationException ("ResultSet.updateBlob(String,java.sql.Blob) unsupported"); 2540 } 2541 2542 public void updateClob(int columnIndex, Clob x) throws SQLException { 2543 throw new UnsupportedOperationException ("ResultSet.updateClob(int,java.sql.Clob) unsupported"); 2544 } 2545 2546 public void updateClob(String columnName, Clob x) throws SQLException { 2547 throw new UnsupportedOperationException ("ResultSet.updateClob(String,java.sql.Clob) unsupported"); 2548 } 2549 2550 public void updateArray(int columnIndex, Array x) throws SQLException { 2551 throw new UnsupportedOperationException ("ResultSet.updateArray(int,java.sql.Array) unsupported"); 2552 } 2553 2554 public void updateArray(String columnName, Array x) throws SQLException { 2555 throw new UnsupportedOperationException ("ResultSet.updateArray(String,java.sql.Array) unsupported"); 2556 } 2557 2558 2574} 2575 2576 | Popular Tags |