0001: /*
0002: * Licensed under the X license (see http://www.x.org/terms.htm)
0003: */
0004: package org.ofbiz.minerva.pool.jdbc;
0005:
0006: import java.net.URL;
0007: import java.sql.Array;
0008: import java.sql.Blob;
0009: import java.sql.Clob;
0010: import java.sql.Date;
0011: import java.sql.Ref;
0012: import java.sql.ResultSet;
0013: import java.sql.ResultSetMetaData;
0014: import java.sql.SQLException;
0015: import java.sql.SQLWarning;
0016: import java.sql.Statement;
0017: import java.sql.Time;
0018: import java.sql.Timestamp;
0019:
0020: /**
0021: * Wraps a result set to track the last used time for the owning connection.
0022: * That time is updated every time a navigation action is performed on the
0023: * result set (next, previous, etc.).
0024: *
0025: * @author Aaron Mulder (ammulder@alumni.princeton.edu)
0026: */
0027: public class ResultSetInPool implements ResultSet {
0028:
0029: private final static String CLOSED = "ResultSet has been closed!";
0030: private ResultSet impl;
0031: private StatementInPool st;
0032:
0033: /**
0034: * Creates a new wrapper from a source result set and statement wrapper.
0035: */
0036: ResultSetInPool(ResultSet source, StatementInPool owner) {
0037: impl = source;
0038: st = owner;
0039: }
0040:
0041: /**
0042: * Updates the last used time for the owning connection to the current time.
0043: */
0044: public void setLastUsed() {
0045: st.setLastUsed();
0046: }
0047:
0048: /**
0049: * Indicates that an error occured on the owning statement.
0050: */
0051: public void setError(SQLException e) {
0052: if (st != null)
0053: st.setError(e);
0054: }
0055:
0056: /**
0057: * Gets a reference to the "real" ResultSet. This should only be used if
0058: * you need to cast that to a specific type to call a proprietary method -
0059: * you will defeat all the pooling if you use the underlying ResultSet
0060: * directly.
0061: */
0062: public ResultSet getUnderlyingResultSet() {
0063: return impl;
0064: }
0065:
0066: // ---- Implementation of java.sql.ResultSet ----
0067:
0068: public boolean absolute(int arg0) throws SQLException {
0069: if (impl == null)
0070: throw new SQLException(CLOSED);
0071: setLastUsed();
0072: try {
0073: return impl.absolute(arg0);
0074: } catch (SQLException e) {
0075: setError(e);
0076: throw e;
0077: }
0078: }
0079:
0080: public void afterLast() throws SQLException {
0081: if (impl == null)
0082: throw new SQLException(CLOSED);
0083: setLastUsed();
0084: try {
0085: impl.afterLast();
0086: } catch (SQLException e) {
0087: setError(e);
0088: throw e;
0089: }
0090: }
0091:
0092: public void beforeFirst() throws SQLException {
0093: if (impl == null)
0094: throw new SQLException(CLOSED);
0095: setLastUsed();
0096: try {
0097: impl.beforeFirst();
0098: } catch (SQLException e) {
0099: setError(e);
0100: throw e;
0101: }
0102: }
0103:
0104: public void cancelRowUpdates() throws SQLException {
0105: if (impl == null)
0106: throw new SQLException(CLOSED);
0107: try {
0108: impl.cancelRowUpdates();
0109: } catch (SQLException e) {
0110: setError(e);
0111: throw e;
0112: }
0113: }
0114:
0115: public void clearWarnings() throws SQLException {
0116: if (impl == null)
0117: throw new SQLException(CLOSED);
0118: try {
0119: impl.clearWarnings();
0120: } catch (SQLException e) {
0121: setError(e);
0122: throw e;
0123: }
0124: }
0125:
0126: public void close() throws SQLException {
0127: if (impl != null) {
0128: try {
0129: impl.close();
0130: } catch (SQLException e) {
0131: }
0132: impl = null;
0133: }
0134: st = null;
0135: }
0136:
0137: public void deleteRow() throws SQLException {
0138: if (impl == null)
0139: throw new SQLException(CLOSED);
0140: setLastUsed();
0141: try {
0142: impl.deleteRow();
0143: } catch (SQLException e) {
0144: setError(e);
0145: throw e;
0146: }
0147: }
0148:
0149: public int findColumn(String arg0) throws SQLException {
0150: if (impl == null)
0151: throw new SQLException(CLOSED);
0152: try {
0153: return impl.findColumn(arg0);
0154: } catch (SQLException e) {
0155: setError(e);
0156: throw e;
0157: }
0158: }
0159:
0160: public boolean first() throws SQLException {
0161: if (impl == null)
0162: throw new SQLException(CLOSED);
0163: setLastUsed();
0164: try {
0165: return impl.first();
0166: } catch (SQLException e) {
0167: setError(e);
0168: throw e;
0169: }
0170: }
0171:
0172: public Array getArray(int arg0) throws SQLException {
0173: if (impl == null)
0174: throw new SQLException(CLOSED);
0175: try {
0176: return impl.getArray(arg0);
0177: } catch (SQLException e) {
0178: setError(e);
0179: throw e;
0180: }
0181: }
0182:
0183: public Array getArray(String arg0) throws SQLException {
0184: if (impl == null)
0185: throw new SQLException(CLOSED);
0186: try {
0187: return impl.getArray(arg0);
0188: } catch (SQLException e) {
0189: setError(e);
0190: throw e;
0191: }
0192: }
0193:
0194: public java.io.InputStream getAsciiStream(int arg0)
0195: throws SQLException {
0196: if (impl == null)
0197: throw new SQLException(CLOSED);
0198: try {
0199: return impl.getAsciiStream(arg0);
0200: } catch (SQLException e) {
0201: setError(e);
0202: throw e;
0203: }
0204: }
0205:
0206: public java.io.InputStream getAsciiStream(String arg0)
0207: throws SQLException {
0208: if (impl == null)
0209: throw new SQLException(CLOSED);
0210: try {
0211: return impl.getAsciiStream(arg0);
0212: } catch (SQLException e) {
0213: setError(e);
0214: throw e;
0215: }
0216: }
0217:
0218: public java.math.BigDecimal getBigDecimal(int arg0)
0219: throws SQLException {
0220: if (impl == null)
0221: throw new SQLException(CLOSED);
0222: try {
0223: return impl.getBigDecimal(arg0);
0224: } catch (SQLException e) {
0225: setError(e);
0226: throw e;
0227: }
0228: }
0229:
0230: public java.math.BigDecimal getBigDecimal(int arg0, int arg1)
0231: throws SQLException {
0232: if (impl == null)
0233: throw new SQLException(CLOSED);
0234: try {
0235: return impl.getBigDecimal(arg0, arg1);
0236: } catch (SQLException e) {
0237: setError(e);
0238: throw e;
0239: }
0240: }
0241:
0242: public java.math.BigDecimal getBigDecimal(String arg0)
0243: throws SQLException {
0244: if (impl == null)
0245: throw new SQLException(CLOSED);
0246: try {
0247: return impl.getBigDecimal(arg0);
0248: } catch (SQLException e) {
0249: setError(e);
0250: throw e;
0251: }
0252: }
0253:
0254: public java.math.BigDecimal getBigDecimal(String arg0, int arg1)
0255: throws SQLException {
0256: if (impl == null)
0257: throw new SQLException(CLOSED);
0258: try {
0259: return impl.getBigDecimal(arg0, arg1);
0260: } catch (SQLException e) {
0261: setError(e);
0262: throw e;
0263: }
0264: }
0265:
0266: public java.io.InputStream getBinaryStream(int arg0)
0267: throws SQLException {
0268: if (impl == null)
0269: throw new SQLException(CLOSED);
0270: try {
0271: return impl.getBinaryStream(arg0);
0272: } catch (SQLException e) {
0273: setError(e);
0274: throw e;
0275: }
0276: }
0277:
0278: public java.io.InputStream getBinaryStream(String arg0)
0279: throws SQLException {
0280: if (impl == null)
0281: throw new SQLException(CLOSED);
0282: try {
0283: return impl.getBinaryStream(arg0);
0284: } catch (SQLException e) {
0285: setError(e);
0286: throw e;
0287: }
0288: }
0289:
0290: public Blob getBlob(int arg0) throws SQLException {
0291: if (impl == null)
0292: throw new SQLException(CLOSED);
0293: try {
0294: return impl.getBlob(arg0);
0295: } catch (SQLException e) {
0296: setError(e);
0297: throw e;
0298: }
0299: }
0300:
0301: public Blob getBlob(String arg0) throws SQLException {
0302: if (impl == null)
0303: throw new SQLException(CLOSED);
0304: try {
0305: return impl.getBlob(arg0);
0306: } catch (SQLException e) {
0307: setError(e);
0308: throw e;
0309: }
0310: }
0311:
0312: public boolean getBoolean(int arg0) throws SQLException {
0313: if (impl == null)
0314: throw new SQLException(CLOSED);
0315: try {
0316: return impl.getBoolean(arg0);
0317: } catch (SQLException e) {
0318: setError(e);
0319: throw e;
0320: }
0321: }
0322:
0323: public boolean getBoolean(String arg0) throws SQLException {
0324: if (impl == null)
0325: throw new SQLException(CLOSED);
0326: try {
0327: return impl.getBoolean(arg0);
0328: } catch (SQLException e) {
0329: setError(e);
0330: throw e;
0331: }
0332: }
0333:
0334: public byte getByte(int arg0) throws SQLException {
0335: if (impl == null)
0336: throw new SQLException(CLOSED);
0337: try {
0338: return impl.getByte(arg0);
0339: } catch (SQLException e) {
0340: setError(e);
0341: throw e;
0342: }
0343: }
0344:
0345: public byte getByte(String arg0) throws SQLException {
0346: if (impl == null)
0347: throw new SQLException(CLOSED);
0348: try {
0349: return impl.getByte(arg0);
0350: } catch (SQLException e) {
0351: setError(e);
0352: throw e;
0353: }
0354: }
0355:
0356: public byte[] getBytes(int arg0) throws SQLException {
0357: if (impl == null)
0358: throw new SQLException(CLOSED);
0359: try {
0360: return impl.getBytes(arg0);
0361: } catch (SQLException e) {
0362: setError(e);
0363: throw e;
0364: }
0365: }
0366:
0367: public byte[] getBytes(String arg0) throws SQLException {
0368: if (impl == null)
0369: throw new SQLException(CLOSED);
0370: try {
0371: return impl.getBytes(arg0);
0372: } catch (SQLException e) {
0373: setError(e);
0374: throw e;
0375: }
0376: }
0377:
0378: public java.io.Reader getCharacterStream(int arg0)
0379: throws SQLException {
0380: if (impl == null)
0381: throw new SQLException(CLOSED);
0382: try {
0383: return impl.getCharacterStream(arg0);
0384: } catch (SQLException e) {
0385: setError(e);
0386: throw e;
0387: }
0388: }
0389:
0390: public java.io.Reader getCharacterStream(String arg0)
0391: throws SQLException {
0392: if (impl == null)
0393: throw new SQLException(CLOSED);
0394: try {
0395: return impl.getCharacterStream(arg0);
0396: } catch (SQLException e) {
0397: setError(e);
0398: throw e;
0399: }
0400: }
0401:
0402: public Clob getClob(int arg0) throws SQLException {
0403: if (impl == null)
0404: throw new SQLException(CLOSED);
0405: try {
0406: return impl.getClob(arg0);
0407: } catch (SQLException e) {
0408: setError(e);
0409: throw e;
0410: }
0411: }
0412:
0413: public Clob getClob(String arg0) throws SQLException {
0414: if (impl == null)
0415: throw new SQLException(CLOSED);
0416: try {
0417: return impl.getClob(arg0);
0418: } catch (SQLException e) {
0419: setError(e);
0420: throw e;
0421: }
0422: }
0423:
0424: public int getConcurrency() throws SQLException {
0425: if (impl == null)
0426: throw new SQLException(CLOSED);
0427: try {
0428: return impl.getConcurrency();
0429: } catch (SQLException e) {
0430: setError(e);
0431: throw e;
0432: }
0433: }
0434:
0435: public String getCursorName() throws SQLException {
0436: if (impl == null)
0437: throw new SQLException(CLOSED);
0438: try {
0439: return impl.getCursorName();
0440: } catch (SQLException e) {
0441: setError(e);
0442: throw e;
0443: }
0444: }
0445:
0446: public Date getDate(int arg0) throws SQLException {
0447: if (impl == null)
0448: throw new SQLException(CLOSED);
0449: try {
0450: return impl.getDate(arg0);
0451: } catch (SQLException e) {
0452: setError(e);
0453: throw e;
0454: }
0455: }
0456:
0457: public Date getDate(int arg0, java.util.Calendar arg1)
0458: throws SQLException {
0459: if (impl == null)
0460: throw new SQLException(CLOSED);
0461: try {
0462: return impl.getDate(arg0, arg1);
0463: } catch (SQLException e) {
0464: setError(e);
0465: throw e;
0466: }
0467: }
0468:
0469: public Date getDate(String arg0) throws SQLException {
0470: if (impl == null)
0471: throw new SQLException(CLOSED);
0472: try {
0473: return impl.getDate(arg0);
0474: } catch (SQLException e) {
0475: setError(e);
0476: throw e;
0477: }
0478: }
0479:
0480: public Date getDate(String arg0, java.util.Calendar arg1)
0481: throws SQLException {
0482: if (impl == null)
0483: throw new SQLException(CLOSED);
0484: try {
0485: return impl.getDate(arg0, arg1);
0486: } catch (SQLException e) {
0487: setError(e);
0488: throw e;
0489: }
0490: }
0491:
0492: public double getDouble(int arg0) throws SQLException {
0493: if (impl == null)
0494: throw new SQLException(CLOSED);
0495: try {
0496: return impl.getDouble(arg0);
0497: } catch (SQLException e) {
0498: setError(e);
0499: throw e;
0500: }
0501: }
0502:
0503: public double getDouble(String arg0) throws SQLException {
0504: if (impl == null)
0505: throw new SQLException(CLOSED);
0506: try {
0507: return impl.getDouble(arg0);
0508: } catch (SQLException e) {
0509: setError(e);
0510: throw e;
0511: }
0512: }
0513:
0514: public int getFetchDirection() throws SQLException {
0515: if (impl == null)
0516: throw new SQLException(CLOSED);
0517: try {
0518: return impl.getFetchDirection();
0519: } catch (SQLException e) {
0520: setError(e);
0521: throw e;
0522: }
0523: }
0524:
0525: public int getFetchSize() throws SQLException {
0526: if (impl == null)
0527: throw new SQLException(CLOSED);
0528: try {
0529: return impl.getFetchSize();
0530: } catch (SQLException e) {
0531: setError(e);
0532: throw e;
0533: }
0534: }
0535:
0536: public float getFloat(int arg0) throws SQLException {
0537: if (impl == null)
0538: throw new SQLException(CLOSED);
0539: try {
0540: return impl.getFloat(arg0);
0541: } catch (SQLException e) {
0542: setError(e);
0543: throw e;
0544: }
0545: }
0546:
0547: public float getFloat(String arg0) throws SQLException {
0548: if (impl == null)
0549: throw new SQLException(CLOSED);
0550: try {
0551: return impl.getFloat(arg0);
0552: } catch (SQLException e) {
0553: setError(e);
0554: throw e;
0555: }
0556: }
0557:
0558: public int getInt(int arg0) throws SQLException {
0559: if (impl == null)
0560: throw new SQLException(CLOSED);
0561: try {
0562: return impl.getInt(arg0);
0563: } catch (SQLException e) {
0564: setError(e);
0565: throw e;
0566: }
0567: }
0568:
0569: public int getInt(String arg0) throws SQLException {
0570: if (impl == null)
0571: throw new SQLException(CLOSED);
0572: try {
0573: return impl.getInt(arg0);
0574: } catch (SQLException e) {
0575: setError(e);
0576: throw e;
0577: }
0578: }
0579:
0580: public long getLong(int arg0) throws SQLException {
0581: if (impl == null)
0582: throw new SQLException(CLOSED);
0583: try {
0584: return impl.getLong(arg0);
0585: } catch (SQLException e) {
0586: setError(e);
0587: throw e;
0588: }
0589: }
0590:
0591: public long getLong(String arg0) throws SQLException {
0592: if (impl == null)
0593: throw new SQLException(CLOSED);
0594: try {
0595: return impl.getLong(arg0);
0596: } catch (SQLException e) {
0597: setError(e);
0598: throw e;
0599: }
0600: }
0601:
0602: public ResultSetMetaData getMetaData() throws SQLException {
0603: if (impl == null)
0604: throw new SQLException(CLOSED);
0605: try {
0606: return impl.getMetaData();
0607: } catch (SQLException e) {
0608: setError(e);
0609: throw e;
0610: }
0611: }
0612:
0613: public Object getObject(int arg0) throws SQLException {
0614: if (impl == null)
0615: throw new SQLException(CLOSED);
0616: try {
0617: return impl.getObject(arg0);
0618: } catch (SQLException e) {
0619: setError(e);
0620: throw e;
0621: }
0622: }
0623:
0624: public Object getObject(int arg0, java.util.Map arg1)
0625: throws SQLException {
0626: if (impl == null)
0627: throw new SQLException(CLOSED);
0628: try {
0629: return impl.getObject(arg0, arg1);
0630: } catch (SQLException e) {
0631: setError(e);
0632: throw e;
0633: }
0634: }
0635:
0636: public Object getObject(String arg0) throws SQLException {
0637: if (impl == null)
0638: throw new SQLException(CLOSED);
0639: try {
0640: return impl.getObject(arg0);
0641: } catch (SQLException e) {
0642: setError(e);
0643: throw e;
0644: }
0645: }
0646:
0647: public Object getObject(String arg0, java.util.Map arg1)
0648: throws SQLException {
0649: if (impl == null)
0650: throw new SQLException(CLOSED);
0651: try {
0652: return impl.getObject(arg0, arg1);
0653: } catch (SQLException e) {
0654: setError(e);
0655: throw e;
0656: }
0657: }
0658:
0659: public Ref getRef(int arg0) throws SQLException {
0660: if (impl == null)
0661: throw new SQLException(CLOSED);
0662: try {
0663: return impl.getRef(arg0);
0664: } catch (SQLException e) {
0665: setError(e);
0666: throw e;
0667: }
0668: }
0669:
0670: public Ref getRef(String arg0) throws SQLException {
0671: if (impl == null)
0672: throw new SQLException(CLOSED);
0673: try {
0674: return impl.getRef(arg0);
0675: } catch (SQLException e) {
0676: setError(e);
0677: throw e;
0678: }
0679: }
0680:
0681: public int getRow() throws SQLException {
0682: if (impl == null)
0683: throw new SQLException(CLOSED);
0684: try {
0685: return impl.getRow();
0686: } catch (SQLException e) {
0687: setError(e);
0688: throw e;
0689: }
0690: }
0691:
0692: public short getShort(int arg0) throws SQLException {
0693: if (impl == null)
0694: throw new SQLException(CLOSED);
0695: try {
0696: return impl.getShort(arg0);
0697: } catch (SQLException e) {
0698: setError(e);
0699: throw e;
0700: }
0701: }
0702:
0703: public short getShort(String arg0) throws SQLException {
0704: if (impl == null)
0705: throw new SQLException(CLOSED);
0706: try {
0707: return impl.getShort(arg0);
0708: } catch (SQLException e) {
0709: setError(e);
0710: throw e;
0711: }
0712: }
0713:
0714: public Statement getStatement() throws SQLException {
0715: if (impl == null)
0716: throw new SQLException(CLOSED);
0717: try {
0718: return impl.getStatement();
0719: } catch (SQLException e) {
0720: setError(e);
0721: throw e;
0722: }
0723: }
0724:
0725: public String getString(int arg0) throws SQLException {
0726: if (impl == null)
0727: throw new SQLException(CLOSED);
0728: try {
0729: return impl.getString(arg0);
0730: } catch (SQLException e) {
0731: setError(e);
0732: throw e;
0733: }
0734: }
0735:
0736: public String getString(String arg0) throws SQLException {
0737: if (impl == null)
0738: throw new SQLException(CLOSED);
0739: try {
0740: return impl.getString(arg0);
0741: } catch (SQLException e) {
0742: setError(e);
0743: throw e;
0744: }
0745: }
0746:
0747: public Time getTime(int arg0) throws SQLException {
0748: if (impl == null)
0749: throw new SQLException(CLOSED);
0750: try {
0751: return impl.getTime(arg0);
0752: } catch (SQLException e) {
0753: setError(e);
0754: throw e;
0755: }
0756: }
0757:
0758: public Time getTime(int arg0, java.util.Calendar arg1)
0759: throws SQLException {
0760: if (impl == null)
0761: throw new SQLException(CLOSED);
0762: try {
0763: return impl.getTime(arg0, arg1);
0764: } catch (SQLException e) {
0765: setError(e);
0766: throw e;
0767: }
0768: }
0769:
0770: public Time getTime(String arg0) throws SQLException {
0771: if (impl == null)
0772: throw new SQLException(CLOSED);
0773: try {
0774: return impl.getTime(arg0);
0775: } catch (SQLException e) {
0776: setError(e);
0777: throw e;
0778: }
0779: }
0780:
0781: public Time getTime(String arg0, java.util.Calendar arg1)
0782: throws SQLException {
0783: if (impl == null)
0784: throw new SQLException(CLOSED);
0785: try {
0786: return impl.getTime(arg0, arg1);
0787: } catch (SQLException e) {
0788: setError(e);
0789: throw e;
0790: }
0791: }
0792:
0793: public Timestamp getTimestamp(int arg0) throws SQLException {
0794: if (impl == null)
0795: throw new SQLException(CLOSED);
0796: try {
0797: return impl.getTimestamp(arg0);
0798: } catch (SQLException e) {
0799: setError(e);
0800: throw e;
0801: }
0802: }
0803:
0804: public Timestamp getTimestamp(int arg0, java.util.Calendar arg1)
0805: throws SQLException {
0806: if (impl == null)
0807: throw new SQLException(CLOSED);
0808: try {
0809: return impl.getTimestamp(arg0, arg1);
0810: } catch (SQLException e) {
0811: setError(e);
0812: throw e;
0813: }
0814: }
0815:
0816: public Timestamp getTimestamp(String arg0) throws SQLException {
0817: if (impl == null)
0818: throw new SQLException(CLOSED);
0819: try {
0820: return impl.getTimestamp(arg0);
0821: } catch (SQLException e) {
0822: setError(e);
0823: throw e;
0824: }
0825: }
0826:
0827: public Timestamp getTimestamp(String arg0, java.util.Calendar arg1)
0828: throws SQLException {
0829: if (impl == null)
0830: throw new SQLException(CLOSED);
0831: try {
0832: return impl.getTimestamp(arg0, arg1);
0833: } catch (SQLException e) {
0834: setError(e);
0835: throw e;
0836: }
0837: }
0838:
0839: public int getType() throws SQLException {
0840: if (impl == null)
0841: throw new SQLException(CLOSED);
0842: try {
0843: return impl.getType();
0844: } catch (SQLException e) {
0845: setError(e);
0846: throw e;
0847: }
0848: }
0849:
0850: public java.io.InputStream getUnicodeStream(int arg0)
0851: throws SQLException {
0852: if (impl == null)
0853: throw new SQLException(CLOSED);
0854: try {
0855: return impl.getUnicodeStream(arg0);
0856: } catch (SQLException e) {
0857: setError(e);
0858: throw e;
0859: }
0860: }
0861:
0862: public java.io.InputStream getUnicodeStream(String arg0)
0863: throws SQLException {
0864: if (impl == null)
0865: throw new SQLException(CLOSED);
0866: try {
0867: return impl.getUnicodeStream(arg0);
0868: } catch (SQLException e) {
0869: setError(e);
0870: throw e;
0871: }
0872: }
0873:
0874: public SQLWarning getWarnings() throws SQLException {
0875: if (impl == null)
0876: throw new SQLException(CLOSED);
0877: try {
0878: return impl.getWarnings();
0879: } catch (SQLException e) {
0880: setError(e);
0881: throw e;
0882: }
0883: }
0884:
0885: public void insertRow() throws SQLException {
0886: if (impl == null)
0887: throw new SQLException(CLOSED);
0888: setLastUsed();
0889: try {
0890: impl.insertRow();
0891: } catch (SQLException e) {
0892: setError(e);
0893: throw e;
0894: }
0895: }
0896:
0897: public boolean isAfterLast() throws SQLException {
0898: if (impl == null)
0899: throw new SQLException(CLOSED);
0900: try {
0901: return impl.isAfterLast();
0902: } catch (SQLException e) {
0903: setError(e);
0904: throw e;
0905: }
0906: }
0907:
0908: public boolean isBeforeFirst() throws SQLException {
0909: if (impl == null)
0910: throw new SQLException(CLOSED);
0911: try {
0912: return impl.isBeforeFirst();
0913: } catch (SQLException e) {
0914: setError(e);
0915: throw e;
0916: }
0917: }
0918:
0919: public boolean isFirst() throws SQLException {
0920: if (impl == null)
0921: throw new SQLException(CLOSED);
0922: try {
0923: return impl.isFirst();
0924: } catch (SQLException e) {
0925: setError(e);
0926: throw e;
0927: }
0928: }
0929:
0930: public boolean isLast() throws SQLException {
0931: if (impl == null)
0932: throw new SQLException(CLOSED);
0933: try {
0934: return impl.isLast();
0935: } catch (SQLException e) {
0936: setError(e);
0937: throw e;
0938: }
0939: }
0940:
0941: public boolean last() throws SQLException {
0942: if (impl == null)
0943: throw new SQLException(CLOSED);
0944: setLastUsed();
0945: try {
0946: return impl.last();
0947: } catch (SQLException e) {
0948: setError(e);
0949: throw e;
0950: }
0951: }
0952:
0953: public void moveToCurrentRow() throws SQLException {
0954: if (impl == null)
0955: throw new SQLException(CLOSED);
0956: setLastUsed();
0957: try {
0958: impl.moveToCurrentRow();
0959: } catch (SQLException e) {
0960: setError(e);
0961: throw e;
0962: }
0963: }
0964:
0965: public void moveToInsertRow() throws SQLException {
0966: if (impl == null)
0967: throw new SQLException(CLOSED);
0968: setLastUsed();
0969: try {
0970: impl.moveToInsertRow();
0971: } catch (SQLException e) {
0972: setError(e);
0973: throw e;
0974: }
0975: }
0976:
0977: public boolean next() throws SQLException {
0978: if (impl == null)
0979: throw new SQLException(CLOSED);
0980: setLastUsed();
0981: try {
0982: return impl.next();
0983: } catch (SQLException e) {
0984: setError(e);
0985: throw e;
0986: }
0987: }
0988:
0989: public boolean previous() throws SQLException {
0990: if (impl == null)
0991: throw new SQLException(CLOSED);
0992: setLastUsed();
0993: try {
0994: return impl.previous();
0995: } catch (SQLException e) {
0996: setError(e);
0997: throw e;
0998: }
0999: }
1000:
1001: public void refreshRow() throws SQLException {
1002: if (impl == null)
1003: throw new SQLException(CLOSED);
1004: setLastUsed();
1005: try {
1006: impl.refreshRow();
1007: } catch (SQLException e) {
1008: setError(e);
1009: throw e;
1010: }
1011: }
1012:
1013: public boolean relative(int arg0) throws SQLException {
1014: if (impl == null)
1015: throw new SQLException(CLOSED);
1016: setLastUsed();
1017: try {
1018: return impl.relative(arg0);
1019: } catch (SQLException e) {
1020: setError(e);
1021: throw e;
1022: }
1023: }
1024:
1025: public boolean rowDeleted() throws SQLException {
1026: if (impl == null)
1027: throw new SQLException(CLOSED);
1028: try {
1029: return impl.rowDeleted();
1030: } catch (SQLException e) {
1031: setError(e);
1032: throw e;
1033: }
1034: }
1035:
1036: public boolean rowInserted() throws SQLException {
1037: if (impl == null)
1038: throw new SQLException(CLOSED);
1039: try {
1040: return impl.rowInserted();
1041: } catch (SQLException e) {
1042: setError(e);
1043: throw e;
1044: }
1045: }
1046:
1047: public boolean rowUpdated() throws SQLException {
1048: if (impl == null)
1049: throw new SQLException(CLOSED);
1050: try {
1051: return impl.rowUpdated();
1052: } catch (SQLException e) {
1053: setError(e);
1054: throw e;
1055: }
1056: }
1057:
1058: public void setFetchDirection(int arg0) throws SQLException {
1059: if (impl == null)
1060: throw new SQLException(CLOSED);
1061: try {
1062: impl.setFetchDirection(arg0);
1063: } catch (SQLException e) {
1064: setError(e);
1065: throw e;
1066: }
1067: }
1068:
1069: public void setFetchSize(int arg0) throws SQLException {
1070: if (impl == null)
1071: throw new SQLException(CLOSED);
1072: try {
1073: impl.setFetchSize(arg0);
1074: } catch (SQLException e) {
1075: setError(e);
1076: throw e;
1077: }
1078: }
1079:
1080: public void updateAsciiStream(int arg0, java.io.InputStream arg1,
1081: int arg2) throws SQLException {
1082: if (impl == null)
1083: throw new SQLException(CLOSED);
1084: try {
1085: impl.updateAsciiStream(arg0, arg1, arg2);
1086: } catch (SQLException e) {
1087: setError(e);
1088: throw e;
1089: }
1090: }
1091:
1092: public void updateAsciiStream(String arg0,
1093: java.io.InputStream arg1, int arg2) throws SQLException {
1094: if (impl == null)
1095: throw new SQLException(CLOSED);
1096: try {
1097: impl.updateAsciiStream(arg0, arg1, arg2);
1098: } catch (SQLException e) {
1099: setError(e);
1100: throw e;
1101: }
1102: }
1103:
1104: public void updateBigDecimal(int arg0, java.math.BigDecimal arg1)
1105: throws SQLException {
1106: if (impl == null)
1107: throw new SQLException(CLOSED);
1108: try {
1109: impl.updateBigDecimal(arg0, arg1);
1110: } catch (SQLException e) {
1111: setError(e);
1112: throw e;
1113: }
1114: }
1115:
1116: public void updateBigDecimal(String arg0, java.math.BigDecimal arg1)
1117: throws SQLException {
1118: if (impl == null)
1119: throw new SQLException(CLOSED);
1120: try {
1121: impl.updateBigDecimal(arg0, arg1);
1122: } catch (SQLException e) {
1123: setError(e);
1124: throw e;
1125: }
1126: }
1127:
1128: public void updateBinaryStream(int arg0, java.io.InputStream arg1,
1129: int arg2) throws SQLException {
1130: if (impl == null)
1131: throw new SQLException(CLOSED);
1132: try {
1133: impl.updateBinaryStream(arg0, arg1, arg2);
1134: } catch (SQLException e) {
1135: setError(e);
1136: throw e;
1137: }
1138: }
1139:
1140: public void updateBinaryStream(String arg0,
1141: java.io.InputStream arg1, int arg2) throws SQLException {
1142: if (impl == null)
1143: throw new SQLException(CLOSED);
1144: try {
1145: impl.updateBinaryStream(arg0, arg1, arg2);
1146: } catch (SQLException e) {
1147: setError(e);
1148: throw e;
1149: }
1150: }
1151:
1152: public void updateBoolean(int arg0, boolean arg1)
1153: throws SQLException {
1154: if (impl == null)
1155: throw new SQLException(CLOSED);
1156: try {
1157: impl.updateBoolean(arg0, arg1);
1158: } catch (SQLException e) {
1159: setError(e);
1160: throw e;
1161: }
1162: }
1163:
1164: public void updateBoolean(String arg0, boolean arg1)
1165: throws SQLException {
1166: if (impl == null)
1167: throw new SQLException(CLOSED);
1168: try {
1169: impl.updateBoolean(arg0, arg1);
1170: } catch (SQLException e) {
1171: setError(e);
1172: throw e;
1173: }
1174: }
1175:
1176: public void updateByte(int arg0, byte arg1) throws SQLException {
1177: if (impl == null)
1178: throw new SQLException(CLOSED);
1179: try {
1180: impl.updateByte(arg0, arg1);
1181: } catch (SQLException e) {
1182: setError(e);
1183: throw e;
1184: }
1185: }
1186:
1187: public void updateByte(String arg0, byte arg1) throws SQLException {
1188: if (impl == null)
1189: throw new SQLException(CLOSED);
1190: try {
1191: impl.updateByte(arg0, arg1);
1192: } catch (SQLException e) {
1193: setError(e);
1194: throw e;
1195: }
1196: }
1197:
1198: public void updateBytes(int arg0, byte[] arg1) throws SQLException {
1199: if (impl == null)
1200: throw new SQLException(CLOSED);
1201: try {
1202: impl.updateBytes(arg0, arg1);
1203: } catch (SQLException e) {
1204: setError(e);
1205: throw e;
1206: }
1207: }
1208:
1209: public void updateBytes(String arg0, byte[] arg1)
1210: throws SQLException {
1211: if (impl == null)
1212: throw new SQLException(CLOSED);
1213: try {
1214: impl.updateBytes(arg0, arg1);
1215: } catch (SQLException e) {
1216: setError(e);
1217: throw e;
1218: }
1219: }
1220:
1221: public void updateCharacterStream(int arg0, java.io.Reader arg1,
1222: int arg2) throws SQLException {
1223: if (impl == null)
1224: throw new SQLException(CLOSED);
1225: try {
1226: impl.updateCharacterStream(arg0, arg1, arg2);
1227: } catch (SQLException e) {
1228: setError(e);
1229: throw e;
1230: }
1231: }
1232:
1233: public void updateCharacterStream(String arg0, java.io.Reader arg1,
1234: int arg2) throws SQLException {
1235: if (impl == null)
1236: throw new SQLException(CLOSED);
1237: try {
1238: impl.updateCharacterStream(arg0, arg1, arg2);
1239: } catch (SQLException e) {
1240: setError(e);
1241: throw e;
1242: }
1243: }
1244:
1245: public void updateDate(int arg0, Date arg1) throws SQLException {
1246: if (impl == null)
1247: throw new SQLException(CLOSED);
1248: try {
1249: impl.updateDate(arg0, arg1);
1250: } catch (SQLException e) {
1251: setError(e);
1252: throw e;
1253: }
1254: }
1255:
1256: public void updateDate(String arg0, Date arg1) throws SQLException {
1257: if (impl == null)
1258: throw new SQLException(CLOSED);
1259: try {
1260: impl.updateDate(arg0, arg1);
1261: } catch (SQLException e) {
1262: setError(e);
1263: throw e;
1264: }
1265: }
1266:
1267: public void updateDouble(int arg0, double arg1) throws SQLException {
1268: if (impl == null)
1269: throw new SQLException(CLOSED);
1270: try {
1271: impl.updateDouble(arg0, arg1);
1272: } catch (SQLException e) {
1273: setError(e);
1274: throw e;
1275: }
1276: }
1277:
1278: public void updateDouble(String arg0, double arg1)
1279: throws SQLException {
1280: if (impl == null)
1281: throw new SQLException(CLOSED);
1282: try {
1283: impl.updateDouble(arg0, arg1);
1284: } catch (SQLException e) {
1285: setError(e);
1286: throw e;
1287: }
1288: }
1289:
1290: public void updateFloat(int arg0, float arg1) throws SQLException {
1291: if (impl == null)
1292: throw new SQLException(CLOSED);
1293: try {
1294: impl.updateFloat(arg0, arg1);
1295: } catch (SQLException e) {
1296: setError(e);
1297: throw e;
1298: }
1299: }
1300:
1301: public void updateFloat(String arg0, float arg1)
1302: throws SQLException {
1303: if (impl == null)
1304: throw new SQLException(CLOSED);
1305: try {
1306: impl.updateFloat(arg0, arg1);
1307: } catch (SQLException e) {
1308: setError(e);
1309: throw e;
1310: }
1311: }
1312:
1313: public void updateInt(int arg0, int arg1) throws SQLException {
1314: if (impl == null)
1315: throw new SQLException(CLOSED);
1316: try {
1317: impl.updateInt(arg0, arg1);
1318: } catch (SQLException e) {
1319: setError(e);
1320: throw e;
1321: }
1322: }
1323:
1324: public void updateInt(String arg0, int arg1) throws SQLException {
1325: if (impl == null)
1326: throw new SQLException(CLOSED);
1327: try {
1328: impl.updateInt(arg0, arg1);
1329: } catch (SQLException e) {
1330: setError(e);
1331: throw e;
1332: }
1333: }
1334:
1335: public void updateLong(int arg0, long arg1) throws SQLException {
1336: if (impl == null)
1337: throw new SQLException(CLOSED);
1338: try {
1339: impl.updateLong(arg0, arg1);
1340: } catch (SQLException e) {
1341: setError(e);
1342: throw e;
1343: }
1344: }
1345:
1346: public void updateLong(String arg0, long arg1) throws SQLException {
1347: if (impl == null)
1348: throw new SQLException(CLOSED);
1349: try {
1350: impl.updateLong(arg0, arg1);
1351: } catch (SQLException e) {
1352: setError(e);
1353: throw e;
1354: }
1355: }
1356:
1357: public void updateNull(int arg0) throws SQLException {
1358: if (impl == null)
1359: throw new SQLException(CLOSED);
1360: try {
1361: impl.updateNull(arg0);
1362: } catch (SQLException e) {
1363: setError(e);
1364: throw e;
1365: }
1366: }
1367:
1368: public void updateNull(String arg0) throws SQLException {
1369: if (impl == null)
1370: throw new SQLException(CLOSED);
1371: try {
1372: impl.updateNull(arg0);
1373: } catch (SQLException e) {
1374: setError(e);
1375: throw e;
1376: }
1377: }
1378:
1379: public void updateObject(int arg0, Object arg1) throws SQLException {
1380: if (impl == null)
1381: throw new SQLException(CLOSED);
1382: try {
1383: impl.updateObject(arg0, arg1);
1384: } catch (SQLException e) {
1385: setError(e);
1386: throw e;
1387: }
1388: }
1389:
1390: public void updateObject(int arg0, Object arg1, int arg2)
1391: throws SQLException {
1392: if (impl == null)
1393: throw new SQLException(CLOSED);
1394: try {
1395: impl.updateObject(arg0, arg1, arg2);
1396: } catch (SQLException e) {
1397: setError(e);
1398: throw e;
1399: }
1400: }
1401:
1402: public void updateObject(String arg0, Object arg1)
1403: throws SQLException {
1404: if (impl == null)
1405: throw new SQLException(CLOSED);
1406: try {
1407: impl.updateObject(arg0, arg1);
1408: } catch (SQLException e) {
1409: setError(e);
1410: throw e;
1411: }
1412: }
1413:
1414: public void updateObject(String arg0, Object arg1, int arg2)
1415: throws SQLException {
1416: if (impl == null)
1417: throw new SQLException(CLOSED);
1418: try {
1419: impl.updateObject(arg0, arg1, arg2);
1420: } catch (SQLException e) {
1421: setError(e);
1422: throw e;
1423: }
1424: }
1425:
1426: public void updateRow() throws SQLException {
1427: if (impl == null)
1428: throw new SQLException(CLOSED);
1429: setLastUsed();
1430: try {
1431: impl.updateRow();
1432: } catch (SQLException e) {
1433: setError(e);
1434: throw e;
1435: }
1436: }
1437:
1438: public void updateShort(int arg0, short arg1) throws SQLException {
1439: if (impl == null)
1440: throw new SQLException(CLOSED);
1441: try {
1442: impl.updateShort(arg0, arg1);
1443: } catch (SQLException e) {
1444: setError(e);
1445: throw e;
1446: }
1447: }
1448:
1449: public void updateShort(String arg0, short arg1)
1450: throws SQLException {
1451: if (impl == null)
1452: throw new SQLException(CLOSED);
1453: try {
1454: impl.updateShort(arg0, arg1);
1455: } catch (SQLException e) {
1456: setError(e);
1457: throw e;
1458: }
1459: }
1460:
1461: public void updateString(int arg0, String arg1) throws SQLException {
1462: if (impl == null)
1463: throw new SQLException(CLOSED);
1464: try {
1465: impl.updateString(arg0, arg1);
1466: } catch (SQLException e) {
1467: setError(e);
1468: throw e;
1469: }
1470: }
1471:
1472: public void updateString(String arg0, String arg1)
1473: throws SQLException {
1474: if (impl == null)
1475: throw new SQLException(CLOSED);
1476: try {
1477: impl.updateString(arg0, arg1);
1478: } catch (SQLException e) {
1479: setError(e);
1480: throw e;
1481: }
1482: }
1483:
1484: public void updateTime(int arg0, Time arg1) throws SQLException {
1485: if (impl == null)
1486: throw new SQLException(CLOSED);
1487: try {
1488: impl.updateTime(arg0, arg1);
1489: } catch (SQLException e) {
1490: setError(e);
1491: throw e;
1492: }
1493: }
1494:
1495: public void updateTime(String arg0, Time arg1) throws SQLException {
1496: if (impl == null)
1497: throw new SQLException(CLOSED);
1498: try {
1499: impl.updateTime(arg0, arg1);
1500: } catch (SQLException e) {
1501: setError(e);
1502: throw e;
1503: }
1504: }
1505:
1506: public void updateTimestamp(int arg0, Timestamp arg1)
1507: throws SQLException {
1508: if (impl == null)
1509: throw new SQLException(CLOSED);
1510: try {
1511: impl.updateTimestamp(arg0, arg1);
1512: } catch (SQLException e) {
1513: setError(e);
1514: throw e;
1515: }
1516: }
1517:
1518: public void updateTimestamp(String arg0, Timestamp arg1)
1519: throws SQLException {
1520: if (impl == null)
1521: throw new SQLException(CLOSED);
1522: try {
1523: impl.updateTimestamp(arg0, arg1);
1524: } catch (SQLException e) {
1525: setError(e);
1526: throw e;
1527: }
1528: }
1529:
1530: public boolean wasNull() throws SQLException {
1531: if (impl == null)
1532: throw new SQLException(CLOSED);
1533: try {
1534: return impl.wasNull();
1535: } catch (SQLException e) {
1536: setError(e);
1537: throw e;
1538: }
1539: }
1540:
1541: // ------- J2SE 1.4 methods comment; needed to compile -------
1542:
1543: /* (non-Javadoc)
1544: * @see java.sql.ResultSet#getURL(int)
1545: */
1546: public URL getURL(int arg0) throws SQLException {
1547: // TODO Auto-generated method stub
1548: return null;
1549: }
1550:
1551: /* (non-Javadoc)
1552: * @see java.sql.ResultSet#getURL(java.lang.String)
1553: */
1554: public URL getURL(String arg0) throws SQLException {
1555: // TODO Auto-generated method stub
1556: return null;
1557: }
1558:
1559: /* (non-Javadoc)
1560: * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
1561: */
1562: public void updateRef(int arg0, Ref arg1) throws SQLException {
1563: // TODO Auto-generated method stub
1564:
1565: }
1566:
1567: /* (non-Javadoc)
1568: * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
1569: */
1570: public void updateRef(String arg0, Ref arg1) throws SQLException {
1571: // TODO Auto-generated method stub
1572:
1573: }
1574:
1575: /* (non-Javadoc)
1576: * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
1577: */
1578: public void updateBlob(int arg0, Blob arg1) throws SQLException {
1579: // TODO Auto-generated method stub
1580:
1581: }
1582:
1583: /* (non-Javadoc)
1584: * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
1585: */
1586: public void updateBlob(String arg0, Blob arg1) throws SQLException {
1587: // TODO Auto-generated method stub
1588:
1589: }
1590:
1591: /* (non-Javadoc)
1592: * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
1593: */
1594: public void updateClob(int arg0, Clob arg1) throws SQLException {
1595: // TODO Auto-generated method stub
1596:
1597: }
1598:
1599: /* (non-Javadoc)
1600: * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
1601: */
1602: public void updateClob(String arg0, Clob arg1) throws SQLException {
1603: // TODO Auto-generated method stub
1604:
1605: }
1606:
1607: /* (non-Javadoc)
1608: * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
1609: */
1610: public void updateArray(int arg0, Array arg1) throws SQLException {
1611: // TODO Auto-generated method stub
1612:
1613: }
1614:
1615: /* (non-Javadoc)
1616: * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
1617: */
1618: public void updateArray(String arg0, Array arg1)
1619: throws SQLException {
1620: // TODO Auto-generated method stub
1621:
1622: }
1623:
1624: // ---- End Implementation of ResultSet ----
1625: }
|