0001: /*
0002: * Licensed to the Apache Software Foundation (ASF) under one or more
0003: * contributor license agreements. See the NOTICE file distributed with
0004: * this work for additional information regarding copyright ownership.
0005: * The ASF licenses this file to You under the Apache License, Version 2.0
0006: * (the "License"); you may not use this file except in compliance with
0007: * the License. You may obtain a copy of the License at
0008: *
0009: * http://www.apache.org/licenses/LICENSE-2.0
0010: *
0011: * Unless required by applicable law or agreed to in writing, software
0012: * distributed under the License is distributed on an "AS IS" BASIS,
0013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014: * See the License for the specific language governing permissions and
0015: * limitations under the License.
0016: */
0017:
0018: package org.apache.commons.dbcp;
0019:
0020: import java.sql.ResultSet;
0021: import java.math.BigDecimal;
0022: import java.sql.Date;
0023: import java.sql.Time;
0024: import java.sql.Timestamp;
0025: import java.io.InputStream;
0026: import java.sql.SQLWarning;
0027: import java.sql.ResultSetMetaData;
0028: import java.sql.SQLException;
0029: import java.io.Reader;
0030: import java.sql.Statement;
0031: import java.util.Map;
0032: import java.sql.Ref;
0033: import java.sql.Blob;
0034: import java.sql.Clob;
0035: import java.sql.Array;
0036: import java.util.Calendar;
0037:
0038: /**
0039: * A base delegating implementation of {@link ResultSet}.
0040: * <p>
0041: * All of the methods from the {@link ResultSet} interface
0042: * simply call the corresponding method on the "delegate"
0043: * provided in my constructor.
0044: * <p>
0045: * Extends AbandonedTrace to implement result set tracking and
0046: * logging of code which created the ResultSet. Tracking the
0047: * ResultSet ensures that the Statment which created it can
0048: * close any open ResultSet's on Statement close.
0049: *
0050: * @author Glenn L. Nielsen
0051: * @author James House
0052: * @author Dirk Verbeeck
0053: * @version $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
0054: */
0055: public class DelegatingResultSet extends AbandonedTrace implements
0056: ResultSet {
0057:
0058: /** My delegate. **/
0059: private ResultSet _res;
0060:
0061: /** The Statement that created me, if any. **/
0062: private Statement _stmt;
0063:
0064: /**
0065: * Create a wrapper for the ResultSet which traces this
0066: * ResultSet to the Statement which created it and the
0067: * code which created it.
0068: *
0069: * @param stmt Statement which created this ResultSet
0070: * @param res ResultSet to wrap
0071: */
0072: public DelegatingResultSet(Statement stmt, ResultSet res) {
0073: super ((AbandonedTrace) stmt);
0074: this ._stmt = stmt;
0075: this ._res = res;
0076: }
0077:
0078: public static ResultSet wrapResultSet(Statement stmt, ResultSet rset) {
0079: if (null == rset) {
0080: return null;
0081: } else {
0082: return new DelegatingResultSet(stmt, rset);
0083: }
0084: }
0085:
0086: public ResultSet getDelegate() {
0087: return _res;
0088: }
0089:
0090: public boolean equals(Object obj) {
0091: ResultSet delegate = getInnermostDelegate();
0092: if (delegate == null) {
0093: return false;
0094: }
0095: if (obj instanceof DelegatingResultSet) {
0096: DelegatingResultSet s = (DelegatingResultSet) obj;
0097: return delegate.equals(s.getInnermostDelegate());
0098: } else {
0099: return delegate.equals(obj);
0100: }
0101: }
0102:
0103: public int hashCode() {
0104: Object obj = getInnermostDelegate();
0105: if (obj == null) {
0106: return 0;
0107: }
0108: return obj.hashCode();
0109: }
0110:
0111: /**
0112: * If my underlying {@link ResultSet} is not a
0113: * <tt>DelegatingResultSet</tt>, returns it,
0114: * otherwise recursively invokes this method on
0115: * my delegate.
0116: * <p>
0117: * Hence this method will return the first
0118: * delegate that is not a <tt>DelegatingResultSet</tt>,
0119: * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt>
0120: * delegate can be found by transversing this chain.
0121: * <p>
0122: * This method is useful when you may have nested
0123: * <tt>DelegatingResultSet</tt>s, and you want to make
0124: * sure to obtain a "genuine" {@link ResultSet}.
0125: */
0126: public ResultSet getInnermostDelegate() {
0127: ResultSet r = _res;
0128: while (r != null && r instanceof DelegatingResultSet) {
0129: r = ((DelegatingResultSet) r).getDelegate();
0130: if (this == r) {
0131: return null;
0132: }
0133: }
0134: return r;
0135: }
0136:
0137: public Statement getStatement() throws SQLException {
0138: return _stmt;
0139: }
0140:
0141: /**
0142: * Wrapper for close of ResultSet which removes this
0143: * result set from being traced then calls close on
0144: * the original ResultSet.
0145: */
0146: public void close() throws SQLException {
0147: try {
0148: if (_stmt != null) {
0149: ((AbandonedTrace) _stmt).removeTrace(this );
0150: _stmt = null;
0151: }
0152: _res.close();
0153: } catch (SQLException e) {
0154: handleException(e);
0155: }
0156: }
0157:
0158: protected void handleException(SQLException e) throws SQLException {
0159: if ((_stmt != null) && (_stmt instanceof DelegatingStatement)) {
0160: ((DelegatingStatement) _stmt).handleException(e);
0161: } else {
0162: throw e;
0163: }
0164: }
0165:
0166: public boolean next() throws SQLException {
0167: try {
0168: return _res.next();
0169: } catch (SQLException e) {
0170: handleException(e);
0171: return false;
0172: }
0173: }
0174:
0175: public boolean wasNull() throws SQLException {
0176: try {
0177: return _res.wasNull();
0178: } catch (SQLException e) {
0179: handleException(e);
0180: return false;
0181: }
0182: }
0183:
0184: public String getString(int columnIndex) throws SQLException {
0185: try {
0186: return _res.getString(columnIndex);
0187: } catch (SQLException e) {
0188: handleException(e);
0189: return null;
0190: }
0191: }
0192:
0193: public boolean getBoolean(int columnIndex) throws SQLException {
0194: try {
0195: return _res.getBoolean(columnIndex);
0196: } catch (SQLException e) {
0197: handleException(e);
0198: return false;
0199: }
0200: }
0201:
0202: public byte getByte(int columnIndex) throws SQLException {
0203: try {
0204: return _res.getByte(columnIndex);
0205: } catch (SQLException e) {
0206: handleException(e);
0207: return 0;
0208: }
0209: }
0210:
0211: public short getShort(int columnIndex) throws SQLException {
0212: try {
0213: return _res.getShort(columnIndex);
0214: } catch (SQLException e) {
0215: handleException(e);
0216: return 0;
0217: }
0218: }
0219:
0220: public int getInt(int columnIndex) throws SQLException {
0221: try {
0222: return _res.getInt(columnIndex);
0223: } catch (SQLException e) {
0224: handleException(e);
0225: return 0;
0226: }
0227: }
0228:
0229: public long getLong(int columnIndex) throws SQLException {
0230: try {
0231: return _res.getLong(columnIndex);
0232: } catch (SQLException e) {
0233: handleException(e);
0234: return 0;
0235: }
0236: }
0237:
0238: public float getFloat(int columnIndex) throws SQLException {
0239: try {
0240: return _res.getFloat(columnIndex);
0241: } catch (SQLException e) {
0242: handleException(e);
0243: return 0;
0244: }
0245: }
0246:
0247: public double getDouble(int columnIndex) throws SQLException {
0248: try {
0249: return _res.getDouble(columnIndex);
0250: } catch (SQLException e) {
0251: handleException(e);
0252: return 0;
0253: }
0254: }
0255:
0256: /** @deprecated */
0257: public BigDecimal getBigDecimal(int columnIndex, int scale)
0258: throws SQLException {
0259: try {
0260: return _res.getBigDecimal(columnIndex);
0261: } catch (SQLException e) {
0262: handleException(e);
0263: return null;
0264: }
0265: }
0266:
0267: public byte[] getBytes(int columnIndex) throws SQLException {
0268: try {
0269: return _res.getBytes(columnIndex);
0270: } catch (SQLException e) {
0271: handleException(e);
0272: return null;
0273: }
0274: }
0275:
0276: public Date getDate(int columnIndex) throws SQLException {
0277: try {
0278: return _res.getDate(columnIndex);
0279: } catch (SQLException e) {
0280: handleException(e);
0281: return null;
0282: }
0283: }
0284:
0285: public Time getTime(int columnIndex) throws SQLException {
0286: try {
0287: return _res.getTime(columnIndex);
0288: } catch (SQLException e) {
0289: handleException(e);
0290: return null;
0291: }
0292: }
0293:
0294: public Timestamp getTimestamp(int columnIndex) throws SQLException {
0295: try {
0296: return _res.getTimestamp(columnIndex);
0297: } catch (SQLException e) {
0298: handleException(e);
0299: return null;
0300: }
0301: }
0302:
0303: public InputStream getAsciiStream(int columnIndex)
0304: throws SQLException {
0305: try {
0306: return _res.getAsciiStream(columnIndex);
0307: } catch (SQLException e) {
0308: handleException(e);
0309: return null;
0310: }
0311: }
0312:
0313: /** @deprecated */
0314: public InputStream getUnicodeStream(int columnIndex)
0315: throws SQLException {
0316: try {
0317: return _res.getUnicodeStream(columnIndex);
0318: } catch (SQLException e) {
0319: handleException(e);
0320: return null;
0321: }
0322: }
0323:
0324: public InputStream getBinaryStream(int columnIndex)
0325: throws SQLException {
0326: try {
0327: return _res.getBinaryStream(columnIndex);
0328: } catch (SQLException e) {
0329: handleException(e);
0330: return null;
0331: }
0332: }
0333:
0334: public String getString(String columnName) throws SQLException {
0335: try {
0336: return _res.getString(columnName);
0337: } catch (SQLException e) {
0338: handleException(e);
0339: return null;
0340: }
0341: }
0342:
0343: public boolean getBoolean(String columnName) throws SQLException {
0344: try {
0345: return _res.getBoolean(columnName);
0346: } catch (SQLException e) {
0347: handleException(e);
0348: return false;
0349: }
0350: }
0351:
0352: public byte getByte(String columnName) throws SQLException {
0353: try {
0354: return _res.getByte(columnName);
0355: } catch (SQLException e) {
0356: handleException(e);
0357: return 0;
0358: }
0359: }
0360:
0361: public short getShort(String columnName) throws SQLException {
0362: try {
0363: return _res.getShort(columnName);
0364: } catch (SQLException e) {
0365: handleException(e);
0366: return 0;
0367: }
0368: }
0369:
0370: public int getInt(String columnName) throws SQLException {
0371: try {
0372: return _res.getInt(columnName);
0373: } catch (SQLException e) {
0374: handleException(e);
0375: return 0;
0376: }
0377: }
0378:
0379: public long getLong(String columnName) throws SQLException {
0380: try {
0381: return _res.getLong(columnName);
0382: } catch (SQLException e) {
0383: handleException(e);
0384: return 0;
0385: }
0386: }
0387:
0388: public float getFloat(String columnName) throws SQLException {
0389: try {
0390: return _res.getFloat(columnName);
0391: } catch (SQLException e) {
0392: handleException(e);
0393: return 0;
0394: }
0395: }
0396:
0397: public double getDouble(String columnName) throws SQLException {
0398: try {
0399: return _res.getDouble(columnName);
0400: } catch (SQLException e) {
0401: handleException(e);
0402: return 0;
0403: }
0404: }
0405:
0406: /** @deprecated */
0407: public BigDecimal getBigDecimal(String columnName, int scale)
0408: throws SQLException {
0409: try {
0410: return _res.getBigDecimal(columnName);
0411: } catch (SQLException e) {
0412: handleException(e);
0413: return null;
0414: }
0415: }
0416:
0417: public byte[] getBytes(String columnName) throws SQLException {
0418: try {
0419: return _res.getBytes(columnName);
0420: } catch (SQLException e) {
0421: handleException(e);
0422: return null;
0423: }
0424: }
0425:
0426: public Date getDate(String columnName) throws SQLException {
0427: try {
0428: return _res.getDate(columnName);
0429: } catch (SQLException e) {
0430: handleException(e);
0431: return null;
0432: }
0433: }
0434:
0435: public Time getTime(String columnName) throws SQLException {
0436: try {
0437: return _res.getTime(columnName);
0438: } catch (SQLException e) {
0439: handleException(e);
0440: return null;
0441: }
0442: }
0443:
0444: public Timestamp getTimestamp(String columnName)
0445: throws SQLException {
0446: try {
0447: return _res.getTimestamp(columnName);
0448: } catch (SQLException e) {
0449: handleException(e);
0450: return null;
0451: }
0452: }
0453:
0454: public InputStream getAsciiStream(String columnName)
0455: throws SQLException {
0456: try {
0457: return _res.getAsciiStream(columnName);
0458: } catch (SQLException e) {
0459: handleException(e);
0460: return null;
0461: }
0462: }
0463:
0464: /** @deprecated */
0465: public InputStream getUnicodeStream(String columnName)
0466: throws SQLException {
0467: try {
0468: return _res.getUnicodeStream(columnName);
0469: } catch (SQLException e) {
0470: handleException(e);
0471: return null;
0472: }
0473: }
0474:
0475: public InputStream getBinaryStream(String columnName)
0476: throws SQLException {
0477: try {
0478: return _res.getBinaryStream(columnName);
0479: } catch (SQLException e) {
0480: handleException(e);
0481: return null;
0482: }
0483: }
0484:
0485: public SQLWarning getWarnings() throws SQLException {
0486: try {
0487: return _res.getWarnings();
0488: } catch (SQLException e) {
0489: handleException(e);
0490: return null;
0491: }
0492: }
0493:
0494: public void clearWarnings() throws SQLException {
0495: try {
0496: _res.clearWarnings();
0497: } catch (SQLException e) {
0498: handleException(e);
0499: }
0500: }
0501:
0502: public String getCursorName() throws SQLException {
0503: try {
0504: return _res.getCursorName();
0505: } catch (SQLException e) {
0506: handleException(e);
0507: return null;
0508: }
0509: }
0510:
0511: public ResultSetMetaData getMetaData() throws SQLException {
0512: try {
0513: return _res.getMetaData();
0514: } catch (SQLException e) {
0515: handleException(e);
0516: return null;
0517: }
0518: }
0519:
0520: public Object getObject(int columnIndex) throws SQLException {
0521: try {
0522: return _res.getObject(columnIndex);
0523: } catch (SQLException e) {
0524: handleException(e);
0525: return null;
0526: }
0527: }
0528:
0529: public Object getObject(String columnName) throws SQLException {
0530: try {
0531: return _res.getObject(columnName);
0532: } catch (SQLException e) {
0533: handleException(e);
0534: return null;
0535: }
0536: }
0537:
0538: public int findColumn(String columnName) throws SQLException {
0539: try {
0540: return _res.findColumn(columnName);
0541: } catch (SQLException e) {
0542: handleException(e);
0543: return 0;
0544: }
0545: }
0546:
0547: public Reader getCharacterStream(int columnIndex)
0548: throws SQLException {
0549: try {
0550: return _res.getCharacterStream(columnIndex);
0551: } catch (SQLException e) {
0552: handleException(e);
0553: return null;
0554: }
0555: }
0556:
0557: public Reader getCharacterStream(String columnName)
0558: throws SQLException {
0559: try {
0560: return _res.getCharacterStream(columnName);
0561: } catch (SQLException e) {
0562: handleException(e);
0563: return null;
0564: }
0565: }
0566:
0567: public BigDecimal getBigDecimal(int columnIndex)
0568: throws SQLException {
0569: try {
0570: return _res.getBigDecimal(columnIndex);
0571: } catch (SQLException e) {
0572: handleException(e);
0573: return null;
0574: }
0575: }
0576:
0577: public BigDecimal getBigDecimal(String columnName)
0578: throws SQLException {
0579: try {
0580: return _res.getBigDecimal(columnName);
0581: } catch (SQLException e) {
0582: handleException(e);
0583: return null;
0584: }
0585: }
0586:
0587: public boolean isBeforeFirst() throws SQLException {
0588: try {
0589: return _res.isBeforeFirst();
0590: } catch (SQLException e) {
0591: handleException(e);
0592: return false;
0593: }
0594: }
0595:
0596: public boolean isAfterLast() throws SQLException {
0597: try {
0598: return _res.isAfterLast();
0599: } catch (SQLException e) {
0600: handleException(e);
0601: return false;
0602: }
0603: }
0604:
0605: public boolean isFirst() throws SQLException {
0606: try {
0607: return _res.isFirst();
0608: } catch (SQLException e) {
0609: handleException(e);
0610: return false;
0611: }
0612: }
0613:
0614: public boolean isLast() throws SQLException {
0615: try {
0616: return _res.isLast();
0617: } catch (SQLException e) {
0618: handleException(e);
0619: return false;
0620: }
0621: }
0622:
0623: public void beforeFirst() throws SQLException {
0624: try {
0625: _res.beforeFirst();
0626: } catch (SQLException e) {
0627: handleException(e);
0628: }
0629: }
0630:
0631: public void afterLast() throws SQLException {
0632: try {
0633: _res.afterLast();
0634: } catch (SQLException e) {
0635: handleException(e);
0636: }
0637: }
0638:
0639: public boolean first() throws SQLException {
0640: try {
0641: return _res.first();
0642: } catch (SQLException e) {
0643: handleException(e);
0644: return false;
0645: }
0646: }
0647:
0648: public boolean last() throws SQLException {
0649: try {
0650: return _res.last();
0651: } catch (SQLException e) {
0652: handleException(e);
0653: return false;
0654: }
0655: }
0656:
0657: public int getRow() throws SQLException {
0658: try {
0659: return _res.getRow();
0660: } catch (SQLException e) {
0661: handleException(e);
0662: return 0;
0663: }
0664: }
0665:
0666: public boolean absolute(int row) throws SQLException {
0667: try {
0668: return _res.absolute(row);
0669: } catch (SQLException e) {
0670: handleException(e);
0671: return false;
0672: }
0673: }
0674:
0675: public boolean relative(int rows) throws SQLException {
0676: try {
0677: return _res.relative(rows);
0678: } catch (SQLException e) {
0679: handleException(e);
0680: return false;
0681: }
0682: }
0683:
0684: public boolean previous() throws SQLException {
0685: try {
0686: return _res.previous();
0687: } catch (SQLException e) {
0688: handleException(e);
0689: return false;
0690: }
0691: }
0692:
0693: public void setFetchDirection(int direction) throws SQLException {
0694: try {
0695: _res.setFetchDirection(direction);
0696: } catch (SQLException e) {
0697: handleException(e);
0698: }
0699: }
0700:
0701: public int getFetchDirection() throws SQLException {
0702: try {
0703: return _res.getFetchDirection();
0704: } catch (SQLException e) {
0705: handleException(e);
0706: return 0;
0707: }
0708: }
0709:
0710: public void setFetchSize(int rows) throws SQLException {
0711: try {
0712: _res.setFetchSize(rows);
0713: } catch (SQLException e) {
0714: handleException(e);
0715: }
0716: }
0717:
0718: public int getFetchSize() throws SQLException {
0719: try {
0720: return _res.getFetchSize();
0721: } catch (SQLException e) {
0722: handleException(e);
0723: return 0;
0724: }
0725: }
0726:
0727: public int getType() throws SQLException {
0728: try {
0729: return _res.getType();
0730: } catch (SQLException e) {
0731: handleException(e);
0732: return 0;
0733: }
0734: }
0735:
0736: public int getConcurrency() throws SQLException {
0737: try {
0738: return _res.getConcurrency();
0739: } catch (SQLException e) {
0740: handleException(e);
0741: return 0;
0742: }
0743: }
0744:
0745: public boolean rowUpdated() throws SQLException {
0746: try {
0747: return _res.rowUpdated();
0748: } catch (SQLException e) {
0749: handleException(e);
0750: return false;
0751: }
0752: }
0753:
0754: public boolean rowInserted() throws SQLException {
0755: try {
0756: return _res.rowInserted();
0757: } catch (SQLException e) {
0758: handleException(e);
0759: return false;
0760: }
0761: }
0762:
0763: public boolean rowDeleted() throws SQLException {
0764: try {
0765: return _res.rowDeleted();
0766: } catch (SQLException e) {
0767: handleException(e);
0768: return false;
0769: }
0770: }
0771:
0772: public void updateNull(int columnIndex) throws SQLException {
0773: try {
0774: _res.updateNull(columnIndex);
0775: } catch (SQLException e) {
0776: handleException(e);
0777: }
0778: }
0779:
0780: public void updateBoolean(int columnIndex, boolean x)
0781: throws SQLException {
0782: try {
0783: _res.updateBoolean(columnIndex, x);
0784: } catch (SQLException e) {
0785: handleException(e);
0786: }
0787: }
0788:
0789: public void updateByte(int columnIndex, byte x) throws SQLException {
0790: try {
0791: _res.updateByte(columnIndex, x);
0792: } catch (SQLException e) {
0793: handleException(e);
0794: }
0795: }
0796:
0797: public void updateShort(int columnIndex, short x)
0798: throws SQLException {
0799: try {
0800: _res.updateShort(columnIndex, x);
0801: } catch (SQLException e) {
0802: handleException(e);
0803: }
0804: }
0805:
0806: public void updateInt(int columnIndex, int x) throws SQLException {
0807: try {
0808: _res.updateInt(columnIndex, x);
0809: } catch (SQLException e) {
0810: handleException(e);
0811: }
0812: }
0813:
0814: public void updateLong(int columnIndex, long x) throws SQLException {
0815: try {
0816: _res.updateLong(columnIndex, x);
0817: } catch (SQLException e) {
0818: handleException(e);
0819: }
0820: }
0821:
0822: public void updateFloat(int columnIndex, float x)
0823: throws SQLException {
0824: try {
0825: _res.updateFloat(columnIndex, x);
0826: } catch (SQLException e) {
0827: handleException(e);
0828: }
0829: }
0830:
0831: public void updateDouble(int columnIndex, double x)
0832: throws SQLException {
0833: try {
0834: _res.updateDouble(columnIndex, x);
0835: } catch (SQLException e) {
0836: handleException(e);
0837: }
0838: }
0839:
0840: public void updateBigDecimal(int columnIndex, BigDecimal x)
0841: throws SQLException {
0842: try {
0843: _res.updateBigDecimal(columnIndex, x);
0844: } catch (SQLException e) {
0845: handleException(e);
0846: }
0847: }
0848:
0849: public void updateString(int columnIndex, String x)
0850: throws SQLException {
0851: try {
0852: _res.updateString(columnIndex, x);
0853: } catch (SQLException e) {
0854: handleException(e);
0855: }
0856: }
0857:
0858: public void updateBytes(int columnIndex, byte[] x)
0859: throws SQLException {
0860: try {
0861: _res.updateBytes(columnIndex, x);
0862: } catch (SQLException e) {
0863: handleException(e);
0864: }
0865: }
0866:
0867: public void updateDate(int columnIndex, Date x) throws SQLException {
0868: try {
0869: _res.updateDate(columnIndex, x);
0870: } catch (SQLException e) {
0871: handleException(e);
0872: }
0873: }
0874:
0875: public void updateTime(int columnIndex, Time x) throws SQLException {
0876: try {
0877: _res.updateTime(columnIndex, x);
0878: } catch (SQLException e) {
0879: handleException(e);
0880: }
0881: }
0882:
0883: public void updateTimestamp(int columnIndex, Timestamp x)
0884: throws SQLException {
0885: try {
0886: _res.updateTimestamp(columnIndex, x);
0887: } catch (SQLException e) {
0888: handleException(e);
0889: }
0890: }
0891:
0892: public void updateAsciiStream(int columnIndex, InputStream x,
0893: int length) throws SQLException {
0894: try {
0895: _res.updateAsciiStream(columnIndex, x, length);
0896: } catch (SQLException e) {
0897: handleException(e);
0898: }
0899: }
0900:
0901: public void updateBinaryStream(int columnIndex, InputStream x,
0902: int length) throws SQLException {
0903: try {
0904: _res.updateBinaryStream(columnIndex, x, length);
0905: } catch (SQLException e) {
0906: handleException(e);
0907: }
0908: }
0909:
0910: public void updateCharacterStream(int columnIndex, Reader x,
0911: int length) throws SQLException {
0912: try {
0913: _res.updateCharacterStream(columnIndex, x, length);
0914: } catch (SQLException e) {
0915: handleException(e);
0916: }
0917: }
0918:
0919: public void updateObject(int columnIndex, Object x, int scale)
0920: throws SQLException {
0921: try {
0922: _res.updateObject(columnIndex, x);
0923: } catch (SQLException e) {
0924: handleException(e);
0925: }
0926: }
0927:
0928: public void updateObject(int columnIndex, Object x)
0929: throws SQLException {
0930: try {
0931: _res.updateObject(columnIndex, x);
0932: } catch (SQLException e) {
0933: handleException(e);
0934: }
0935: }
0936:
0937: public void updateNull(String columnName) throws SQLException {
0938: try {
0939: _res.updateNull(columnName);
0940: } catch (SQLException e) {
0941: handleException(e);
0942: }
0943: }
0944:
0945: public void updateBoolean(String columnName, boolean x)
0946: throws SQLException {
0947: try {
0948: _res.updateBoolean(columnName, x);
0949: } catch (SQLException e) {
0950: handleException(e);
0951: }
0952: }
0953:
0954: public void updateByte(String columnName, byte x)
0955: throws SQLException {
0956: try {
0957: _res.updateByte(columnName, x);
0958: } catch (SQLException e) {
0959: handleException(e);
0960: }
0961: }
0962:
0963: public void updateShort(String columnName, short x)
0964: throws SQLException {
0965: try {
0966: _res.updateShort(columnName, x);
0967: } catch (SQLException e) {
0968: handleException(e);
0969: }
0970: }
0971:
0972: public void updateInt(String columnName, int x) throws SQLException {
0973: try {
0974: _res.updateInt(columnName, x);
0975: } catch (SQLException e) {
0976: handleException(e);
0977: }
0978: }
0979:
0980: public void updateLong(String columnName, long x)
0981: throws SQLException {
0982: try {
0983: _res.updateLong(columnName, x);
0984: } catch (SQLException e) {
0985: handleException(e);
0986: }
0987: }
0988:
0989: public void updateFloat(String columnName, float x)
0990: throws SQLException {
0991: try {
0992: _res.updateFloat(columnName, x);
0993: } catch (SQLException e) {
0994: handleException(e);
0995: }
0996: }
0997:
0998: public void updateDouble(String columnName, double x)
0999: throws SQLException {
1000: try {
1001: _res.updateDouble(columnName, x);
1002: } catch (SQLException e) {
1003: handleException(e);
1004: }
1005: }
1006:
1007: public void updateBigDecimal(String columnName, BigDecimal x)
1008: throws SQLException {
1009: try {
1010: _res.updateBigDecimal(columnName, x);
1011: } catch (SQLException e) {
1012: handleException(e);
1013: }
1014: }
1015:
1016: public void updateString(String columnName, String x)
1017: throws SQLException {
1018: try {
1019: _res.updateString(columnName, x);
1020: } catch (SQLException e) {
1021: handleException(e);
1022: }
1023: }
1024:
1025: public void updateBytes(String columnName, byte[] x)
1026: throws SQLException {
1027: try {
1028: _res.updateBytes(columnName, x);
1029: } catch (SQLException e) {
1030: handleException(e);
1031: }
1032: }
1033:
1034: public void updateDate(String columnName, Date x)
1035: throws SQLException {
1036: try {
1037: _res.updateDate(columnName, x);
1038: } catch (SQLException e) {
1039: handleException(e);
1040: }
1041: }
1042:
1043: public void updateTime(String columnName, Time x)
1044: throws SQLException {
1045: try {
1046: _res.updateTime(columnName, x);
1047: } catch (SQLException e) {
1048: handleException(e);
1049: }
1050: }
1051:
1052: public void updateTimestamp(String columnName, Timestamp x)
1053: throws SQLException {
1054: try {
1055: _res.updateTimestamp(columnName, x);
1056: } catch (SQLException e) {
1057: handleException(e);
1058: }
1059: }
1060:
1061: public void updateAsciiStream(String columnName, InputStream x,
1062: int length) throws SQLException {
1063: try {
1064: _res.updateAsciiStream(columnName, x, length);
1065: } catch (SQLException e) {
1066: handleException(e);
1067: }
1068: }
1069:
1070: public void updateBinaryStream(String columnName, InputStream x,
1071: int length) throws SQLException {
1072: try {
1073: _res.updateBinaryStream(columnName, x, length);
1074: } catch (SQLException e) {
1075: handleException(e);
1076: }
1077: }
1078:
1079: public void updateCharacterStream(String columnName, Reader reader,
1080: int length) throws SQLException {
1081: try {
1082: _res.updateCharacterStream(columnName, reader, length);
1083: } catch (SQLException e) {
1084: handleException(e);
1085: }
1086: }
1087:
1088: public void updateObject(String columnName, Object x, int scale)
1089: throws SQLException {
1090: try {
1091: _res.updateObject(columnName, x);
1092: } catch (SQLException e) {
1093: handleException(e);
1094: }
1095: }
1096:
1097: public void updateObject(String columnName, Object x)
1098: throws SQLException {
1099: try {
1100: _res.updateObject(columnName, x);
1101: } catch (SQLException e) {
1102: handleException(e);
1103: }
1104: }
1105:
1106: public void insertRow() throws SQLException {
1107: try {
1108: _res.insertRow();
1109: } catch (SQLException e) {
1110: handleException(e);
1111: }
1112: }
1113:
1114: public void updateRow() throws SQLException {
1115: try {
1116: _res.updateRow();
1117: } catch (SQLException e) {
1118: handleException(e);
1119: }
1120: }
1121:
1122: public void deleteRow() throws SQLException {
1123: try {
1124: _res.deleteRow();
1125: } catch (SQLException e) {
1126: handleException(e);
1127: }
1128: }
1129:
1130: public void refreshRow() throws SQLException {
1131: try {
1132: _res.refreshRow();
1133: } catch (SQLException e) {
1134: handleException(e);
1135: }
1136: }
1137:
1138: public void cancelRowUpdates() throws SQLException {
1139: try {
1140: _res.cancelRowUpdates();
1141: } catch (SQLException e) {
1142: handleException(e);
1143: }
1144: }
1145:
1146: public void moveToInsertRow() throws SQLException {
1147: try {
1148: _res.moveToInsertRow();
1149: } catch (SQLException e) {
1150: handleException(e);
1151: }
1152: }
1153:
1154: public void moveToCurrentRow() throws SQLException {
1155: try {
1156: _res.moveToCurrentRow();
1157: } catch (SQLException e) {
1158: handleException(e);
1159: }
1160: }
1161:
1162: public Object getObject(int i, Map map) throws SQLException {
1163: try {
1164: return _res.getObject(i, map);
1165: } catch (SQLException e) {
1166: handleException(e);
1167: return null;
1168: }
1169: }
1170:
1171: public Ref getRef(int i) throws SQLException {
1172: try {
1173: return _res.getRef(i);
1174: } catch (SQLException e) {
1175: handleException(e);
1176: return null;
1177: }
1178: }
1179:
1180: public Blob getBlob(int i) throws SQLException {
1181: try {
1182: return _res.getBlob(i);
1183: } catch (SQLException e) {
1184: handleException(e);
1185: return null;
1186: }
1187: }
1188:
1189: public Clob getClob(int i) throws SQLException {
1190: try {
1191: return _res.getClob(i);
1192: } catch (SQLException e) {
1193: handleException(e);
1194: return null;
1195: }
1196: }
1197:
1198: public Array getArray(int i) throws SQLException {
1199: try {
1200: return _res.getArray(i);
1201: } catch (SQLException e) {
1202: handleException(e);
1203: return null;
1204: }
1205: }
1206:
1207: public Object getObject(String colName, Map map)
1208: throws SQLException {
1209: try {
1210: return _res.getObject(colName, map);
1211: } catch (SQLException e) {
1212: handleException(e);
1213: return null;
1214: }
1215: }
1216:
1217: public Ref getRef(String colName) throws SQLException {
1218: try {
1219: return _res.getRef(colName);
1220: } catch (SQLException e) {
1221: handleException(e);
1222: return null;
1223: }
1224: }
1225:
1226: public Blob getBlob(String colName) throws SQLException {
1227: try {
1228: return _res.getBlob(colName);
1229: } catch (SQLException e) {
1230: handleException(e);
1231: return null;
1232: }
1233: }
1234:
1235: public Clob getClob(String colName) throws SQLException {
1236: try {
1237: return _res.getClob(colName);
1238: } catch (SQLException e) {
1239: handleException(e);
1240: return null;
1241: }
1242: }
1243:
1244: public Array getArray(String colName) throws SQLException {
1245: try {
1246: return _res.getArray(colName);
1247: } catch (SQLException e) {
1248: handleException(e);
1249: return null;
1250: }
1251: }
1252:
1253: public Date getDate(int columnIndex, Calendar cal)
1254: throws SQLException {
1255: try {
1256: return _res.getDate(columnIndex, cal);
1257: } catch (SQLException e) {
1258: handleException(e);
1259: return null;
1260: }
1261: }
1262:
1263: public Date getDate(String columnName, Calendar cal)
1264: throws SQLException {
1265: try {
1266: return _res.getDate(columnName, cal);
1267: } catch (SQLException e) {
1268: handleException(e);
1269: return null;
1270: }
1271: }
1272:
1273: public Time getTime(int columnIndex, Calendar cal)
1274: throws SQLException {
1275: try {
1276: return _res.getTime(columnIndex, cal);
1277: } catch (SQLException e) {
1278: handleException(e);
1279: return null;
1280: }
1281: }
1282:
1283: public Time getTime(String columnName, Calendar cal)
1284: throws SQLException {
1285: try {
1286: return _res.getTime(columnName, cal);
1287: } catch (SQLException e) {
1288: handleException(e);
1289: return null;
1290: }
1291: }
1292:
1293: public Timestamp getTimestamp(int columnIndex, Calendar cal)
1294: throws SQLException {
1295: try {
1296: return _res.getTimestamp(columnIndex, cal);
1297: } catch (SQLException e) {
1298: handleException(e);
1299: return null;
1300: }
1301: }
1302:
1303: public Timestamp getTimestamp(String columnName, Calendar cal)
1304: throws SQLException {
1305: try {
1306: return _res.getTimestamp(columnName, cal);
1307: } catch (SQLException e) {
1308: handleException(e);
1309: return null;
1310: }
1311: }
1312:
1313: // ------------------- JDBC 3.0 -----------------------------------------
1314: // Will be commented by the build process on a JDBC 2.0 system
1315:
1316: /* JDBC_3_ANT_KEY_BEGIN */
1317:
1318: public java.net.URL getURL(int columnIndex) throws SQLException {
1319: try {
1320: return _res.getURL(columnIndex);
1321: } catch (SQLException e) {
1322: handleException(e);
1323: return null;
1324: }
1325: }
1326:
1327: public java.net.URL getURL(String columnName) throws SQLException {
1328: try {
1329: return _res.getURL(columnName);
1330: } catch (SQLException e) {
1331: handleException(e);
1332: return null;
1333: }
1334: }
1335:
1336: public void updateRef(int columnIndex, java.sql.Ref x)
1337: throws SQLException {
1338: try {
1339: _res.updateRef(columnIndex, x);
1340: } catch (SQLException e) {
1341: handleException(e);
1342: }
1343: }
1344:
1345: public void updateRef(String columnName, java.sql.Ref x)
1346: throws SQLException {
1347: try {
1348: _res.updateRef(columnName, x);
1349: } catch (SQLException e) {
1350: handleException(e);
1351: }
1352: }
1353:
1354: public void updateBlob(int columnIndex, java.sql.Blob x)
1355: throws SQLException {
1356: try {
1357: _res.updateBlob(columnIndex, x);
1358: } catch (SQLException e) {
1359: handleException(e);
1360: }
1361: }
1362:
1363: public void updateBlob(String columnName, java.sql.Blob x)
1364: throws SQLException {
1365: try {
1366: _res.updateBlob(columnName, x);
1367: } catch (SQLException e) {
1368: handleException(e);
1369: }
1370: }
1371:
1372: public void updateClob(int columnIndex, java.sql.Clob x)
1373: throws SQLException {
1374: try {
1375: _res.updateClob(columnIndex, x);
1376: } catch (SQLException e) {
1377: handleException(e);
1378: }
1379: }
1380:
1381: public void updateClob(String columnName, java.sql.Clob x)
1382: throws SQLException {
1383: try {
1384: _res.updateClob(columnName, x);
1385: } catch (SQLException e) {
1386: handleException(e);
1387: }
1388: }
1389:
1390: public void updateArray(int columnIndex, java.sql.Array x)
1391: throws SQLException {
1392: try {
1393: _res.updateArray(columnIndex, x);
1394: } catch (SQLException e) {
1395: handleException(e);
1396: }
1397: }
1398:
1399: public void updateArray(String columnName, java.sql.Array x)
1400: throws SQLException {
1401: try {
1402: _res.updateArray(columnName, x);
1403: } catch (SQLException e) {
1404: handleException(e);
1405: }
1406: }
1407:
1408: /* JDBC_3_ANT_KEY_END */
1409: }
|