0001: /*
0002: * The contents of this file are subject to the
0003: * Mozilla Public License Version 1.1 (the "License");
0004: * you may not use this file except in compliance with the License.
0005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
0006: *
0007: * Software distributed under the License is distributed on an "AS IS"
0008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
0009: * See the License for the specific language governing rights and
0010: * limitations under the License.
0011: *
0012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
0013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
0014: *
0015: * All Rights Reserved.
0016: *
0017: * Contributor(s):
0018: */
0019: package org.openharmonise.commons.dsi;
0020:
0021: import java.io.*;
0022: import java.math.BigDecimal;
0023: import java.net.URL;
0024: import java.sql.*;
0025: import java.util.*;
0026:
0027: /**
0028: *
0029: * An implementation of the <code>ResultSet</code> interface which wraps up
0030: * a result set and its associated <code>Statement</code> such that
0031: * the <code>Statement</code> is closed as well as the <code>ResultSet</code>
0032: * when the <code>close()</code> method is called on this <code>ResultSet</code>.
0033: *
0034: * @author Michael Bell
0035: * @version $Revision: 1.2 $
0036: *
0037: */
0038: public class HarmoniseResultSet implements ResultSet {
0039:
0040: /**
0041: * The statement associated to the result set.
0042: */
0043: Statement m_stmt = null;
0044:
0045: /**
0046: * The result set to wrap.
0047: */
0048: ResultSet m_rs = null;
0049:
0050: /**
0051: * Map of column names to values for the current row. This caching
0052: * of values allows a more flexible access to the data than some
0053: * <code>ResultSet</code> implementations offer.
0054: *
0055: */
0056: Map m_rowcache = new Hashtable();
0057:
0058: /**
0059: * Constructs a result set from the given result set and associated
0060: * statement.
0061: *
0062: * @param stmt the statement
0063: * @param rs the result set
0064: */
0065: HarmoniseResultSet(Statement stmt, ResultSet rs) {
0066: m_stmt = stmt;
0067: m_rs = rs;
0068: }
0069:
0070: /* (non-Javadoc)
0071: * @see java.sql.ResultSet#getString(java.lang.String)
0072: */
0073: public String getString(String str) throws SQLException {
0074: String sResult = null;
0075:
0076: String sKey = this .getCacheKey(str);
0077:
0078: if (m_rowcache.size() > 0) {
0079: sResult = (String) m_rowcache.get(sKey);
0080: }
0081:
0082: if (sResult == null) {
0083: sResult = m_rs.getString(str);
0084: if (sResult != null) {
0085: m_rowcache.put(sKey, sResult);
0086: }
0087: }
0088:
0089: return sResult;
0090: }
0091:
0092: /* (non-Javadoc)
0093: * @see java.sql.ResultSet#getString(int)
0094: */
0095: public String getString(int n) throws SQLException {
0096: String sResult = null;
0097:
0098: String sKey = this .getCacheKey(n);
0099:
0100: if (m_rowcache.size() > 0) {
0101: sResult = (String) m_rowcache.get(sKey);
0102: }
0103:
0104: if (sResult == null) {
0105: sResult = m_rs.getString(n);
0106: if (sResult != null) {
0107: m_rowcache.put(sKey, sResult);
0108: }
0109: }
0110:
0111: return sResult;
0112: }
0113:
0114: /* (non-Javadoc)
0115: * @see java.sql.ResultSet#next()
0116: */
0117: public boolean next() throws SQLException {
0118: m_rowcache.clear();
0119: return (m_rs.next());
0120: }
0121:
0122: /* (non-Javadoc)
0123: * @see java.sql.ResultSet#close()
0124: */
0125: public void close() throws SQLException {
0126: m_rs.close();
0127: m_stmt.close();
0128: }
0129:
0130: /**
0131: * Returns cache key to be used for caching row data.
0132: *
0133: * @param n the int value
0134: * @return a cache key for this <code>int</code> value
0135: */
0136: private String getCacheKey(int n) {
0137: return String.valueOf(n);
0138: }
0139:
0140: /**
0141: * Returns cache key to be used for caching row data.
0142: *
0143: * @param sColumn the name of the column containing the value to be cached
0144: * @return the cahce key for the column
0145: * @throws SQLException if there is an error accessing data from the underlying result set
0146: */
0147: private String getCacheKey(String sColumn) throws SQLException {
0148: String sKey = null;
0149:
0150: int nCols = m_rs.getMetaData().getColumnCount();
0151:
0152: boolean bFound = false;
0153: int i = 1;
0154:
0155: while (i <= nCols && bFound == false) {
0156: if (sColumn.equalsIgnoreCase(m_rs.getMetaData()
0157: .getColumnName(i)) == true) {
0158: bFound = true;
0159: sKey = String.valueOf(i);
0160: }
0161: i++;
0162: }
0163:
0164: return sKey;
0165: }
0166:
0167: /* (non-Javadoc)
0168: * @see java.sql.ResultSet#absolute(int)
0169: */
0170: public boolean absolute(int arg0) throws SQLException {
0171: return m_rs.absolute(arg0);
0172: }
0173:
0174: /* (non-Javadoc)
0175: * @see java.sql.ResultSet#afterLast()
0176: */
0177: public void afterLast() throws SQLException {
0178: m_rs.afterLast();
0179: }
0180:
0181: /* (non-Javadoc)
0182: * @see java.sql.ResultSet#beforeFirst()
0183: */
0184: public void beforeFirst() throws SQLException {
0185: m_rs.beforeFirst();
0186: }
0187:
0188: /* (non-Javadoc)
0189: * @see java.sql.ResultSet#cancelRowUpdates()
0190: */
0191: public void cancelRowUpdates() throws SQLException {
0192: m_rs.cancelRowUpdates();
0193: }
0194:
0195: /* (non-Javadoc)
0196: * @see java.sql.ResultSet#deleteRow()
0197: */
0198: public void deleteRow() throws SQLException {
0199: m_rs.deleteRow();
0200: }
0201:
0202: /* (non-Javadoc)
0203: * @see java.lang.Object#equals(java.lang.Object)
0204: */
0205: public boolean equals(Object arg0) {
0206: return m_rs.equals(arg0);
0207: }
0208:
0209: /* (non-Javadoc)
0210: * @see java.sql.ResultSet#first()
0211: */
0212: public boolean first() throws SQLException {
0213: return m_rs.first();
0214: }
0215:
0216: /* (non-Javadoc)
0217: * @see java.sql.ResultSet#getArray(int)
0218: */
0219: public Array getArray(int arg0) throws SQLException {
0220: return m_rs.getArray(arg0);
0221: }
0222:
0223: /* (non-Javadoc)
0224: * @see java.sql.ResultSet#getArray(java.lang.String)
0225: */
0226: public Array getArray(String arg0) throws SQLException {
0227: return m_rs.getArray(arg0);
0228: }
0229:
0230: /* (non-Javadoc)
0231: * @see java.sql.ResultSet#getBigDecimal(int)
0232: */
0233: public BigDecimal getBigDecimal(int arg0) throws SQLException {
0234: return m_rs.getBigDecimal(arg0);
0235: }
0236:
0237: /* (non-Javadoc)
0238: * @see java.sql.ResultSet#getBigDecimal(java.lang.String)
0239: */
0240: public BigDecimal getBigDecimal(String arg0) throws SQLException {
0241: return m_rs.getBigDecimal(arg0);
0242: }
0243:
0244: /* (non-Javadoc)
0245: * @see java.sql.ResultSet#getBlob(int)
0246: */
0247: public Blob getBlob(int arg0) throws SQLException {
0248: return m_rs.getBlob(arg0);
0249: }
0250:
0251: /* (non-Javadoc)
0252: * @see java.sql.ResultSet#getBlob(java.lang.String)
0253: */
0254: public Blob getBlob(String arg0) throws SQLException {
0255: return m_rs.getBlob(arg0);
0256: }
0257:
0258: /* (non-Javadoc)
0259: * @see java.sql.ResultSet#getCharacterStream(int)
0260: */
0261: public Reader getCharacterStream(int arg0) throws SQLException {
0262: return m_rs.getCharacterStream(arg0);
0263: }
0264:
0265: /* (non-Javadoc)
0266: * @see java.sql.ResultSet#getCharacterStream(java.lang.String)
0267: */
0268: public Reader getCharacterStream(String arg0) throws SQLException {
0269: return m_rs.getCharacterStream(arg0);
0270: }
0271:
0272: /* (non-Javadoc)
0273: * @see java.sql.ResultSet#getClob(int)
0274: */
0275: public Clob getClob(int arg0) throws SQLException {
0276: return m_rs.getClob(arg0);
0277: }
0278:
0279: /* (non-Javadoc)
0280: * @see java.sql.ResultSet#getClob(java.lang.String)
0281: */
0282: public Clob getClob(String arg0) throws SQLException {
0283: return m_rs.getClob(arg0);
0284: }
0285:
0286: /* (non-Javadoc)
0287: * @see java.sql.ResultSet#getConcurrency()
0288: */
0289: public int getConcurrency() throws SQLException {
0290: return m_rs.getConcurrency();
0291: }
0292:
0293: /* (non-Javadoc)
0294: * @see java.sql.ResultSet#getDate(int, java.util.Calendar)
0295: */
0296: public java.sql.Date getDate(int arg0, Calendar arg1)
0297: throws SQLException {
0298: return m_rs.getDate(arg0, arg1);
0299: }
0300:
0301: /* (non-Javadoc)
0302: * @see java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)
0303: */
0304: public java.sql.Date getDate(String arg0, Calendar arg1)
0305: throws SQLException {
0306: return m_rs.getDate(arg0, arg1);
0307: }
0308:
0309: /* (non-Javadoc)
0310: * @see java.sql.ResultSet#getFetchDirection()
0311: */
0312: public int getFetchDirection() throws SQLException {
0313: return m_rs.getFetchDirection();
0314: }
0315:
0316: /* (non-Javadoc)
0317: * @see java.sql.ResultSet#getFetchSize()
0318: */
0319: public int getFetchSize() throws SQLException {
0320: return m_rs.getFetchSize();
0321: }
0322:
0323: /* (non-Javadoc)
0324: * @see java.sql.ResultSet#getObject(int, java.util.Map)
0325: */
0326: public Object getObject(int arg0, Map arg1) throws SQLException {
0327: return m_rs.getObject(arg0, arg1);
0328: }
0329:
0330: /* (non-Javadoc)
0331: * @see java.sql.ResultSet#getObject(java.lang.String, java.util.Map)
0332: */
0333: public Object getObject(String arg0, Map arg1) throws SQLException {
0334: return m_rs.getObject(arg0, arg1);
0335: }
0336:
0337: /* (non-Javadoc)
0338: * @see java.sql.ResultSet#getRef(int)
0339: */
0340: public Ref getRef(int arg0) throws SQLException {
0341: return m_rs.getRef(arg0);
0342: }
0343:
0344: /* (non-Javadoc)
0345: * @see java.sql.ResultSet#getRef(java.lang.String)
0346: */
0347: public Ref getRef(String arg0) throws SQLException {
0348: return m_rs.getRef(arg0);
0349: }
0350:
0351: /* (non-Javadoc)
0352: * @see java.sql.ResultSet#getRow()
0353: */
0354: public int getRow() throws SQLException {
0355: return m_rs.getRow();
0356: }
0357:
0358: /* (non-Javadoc)
0359: * @see java.sql.ResultSet#getStatement()
0360: */
0361: public Statement getStatement() throws SQLException {
0362: return m_rs.getStatement();
0363: }
0364:
0365: /* (non-Javadoc)
0366: * @see java.sql.ResultSet#getTime(int, java.util.Calendar)
0367: */
0368: public Time getTime(int arg0, Calendar arg1) throws SQLException {
0369: return m_rs.getTime(arg0, arg1);
0370: }
0371:
0372: /* (non-Javadoc)
0373: * @see java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)
0374: */
0375: public Time getTime(String arg0, Calendar arg1) throws SQLException {
0376: return m_rs.getTime(arg0, arg1);
0377: }
0378:
0379: /* (non-Javadoc)
0380: * @see java.sql.ResultSet#getTimestamp(int, java.util.Calendar)
0381: */
0382: public Timestamp getTimestamp(int arg0, Calendar arg1)
0383: throws SQLException {
0384: return m_rs.getTimestamp(arg0, arg1);
0385: }
0386:
0387: /* (non-Javadoc)
0388: * @see java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)
0389: */
0390: public Timestamp getTimestamp(String arg0, Calendar arg1)
0391: throws SQLException {
0392: return m_rs.getTimestamp(arg0, arg1);
0393: }
0394:
0395: /* (non-Javadoc)
0396: * @see java.sql.ResultSet#getType()
0397: */
0398: public int getType() throws SQLException {
0399: return m_rs.getType();
0400: }
0401:
0402: /* (non-Javadoc)
0403: * @see java.sql.ResultSet#getURL(int)
0404: */
0405: public URL getURL(int arg0) throws SQLException {
0406: return m_rs.getURL(arg0);
0407: }
0408:
0409: /* (non-Javadoc)
0410: * @see java.sql.ResultSet#getURL(java.lang.String)
0411: */
0412: public URL getURL(String arg0) throws SQLException {
0413: return m_rs.getURL(arg0);
0414: }
0415:
0416: /* (non-Javadoc)
0417: * @see java.lang.Object#hashCode()
0418: */
0419: public int hashCode() {
0420: return m_rs.hashCode();
0421: }
0422:
0423: /* (non-Javadoc)
0424: * @see java.sql.ResultSet#insertRow()
0425: */
0426: public void insertRow() throws SQLException {
0427: m_rs.insertRow();
0428: }
0429:
0430: /* (non-Javadoc)
0431: * @see java.sql.ResultSet#isAfterLast()
0432: */
0433: public boolean isAfterLast() throws SQLException {
0434: return m_rs.isAfterLast();
0435: }
0436:
0437: /* (non-Javadoc)
0438: * @see java.sql.ResultSet#isBeforeFirst()
0439: */
0440: public boolean isBeforeFirst() throws SQLException {
0441: return m_rs.isBeforeFirst();
0442: }
0443:
0444: /* (non-Javadoc)
0445: * @see java.sql.ResultSet#isFirst()
0446: */
0447: public boolean isFirst() throws SQLException {
0448: return m_rs.isFirst();
0449: }
0450:
0451: /* (non-Javadoc)
0452: * @see java.sql.ResultSet#isLast()
0453: */
0454: public boolean isLast() throws SQLException {
0455: return m_rs.isLast();
0456: }
0457:
0458: /* (non-Javadoc)
0459: * @see java.sql.ResultSet#last()
0460: */
0461: public boolean last() throws SQLException {
0462: return m_rs.last();
0463: }
0464:
0465: /* (non-Javadoc)
0466: * @see java.sql.ResultSet#moveToCurrentRow()
0467: */
0468: public void moveToCurrentRow() throws SQLException {
0469: m_rs.moveToCurrentRow();
0470: }
0471:
0472: /* (non-Javadoc)
0473: * @see java.sql.ResultSet#moveToInsertRow()
0474: */
0475: public void moveToInsertRow() throws SQLException {
0476: m_rs.moveToInsertRow();
0477: }
0478:
0479: /* (non-Javadoc)
0480: * @see java.sql.ResultSet#previous()
0481: */
0482: public boolean previous() throws SQLException {
0483: return m_rs.previous();
0484: }
0485:
0486: /* (non-Javadoc)
0487: * @see java.sql.ResultSet#refreshRow()
0488: */
0489: public void refreshRow() throws SQLException {
0490: m_rs.refreshRow();
0491: }
0492:
0493: /* (non-Javadoc)
0494: * @see java.sql.ResultSet#relative(int)
0495: */
0496: public boolean relative(int arg0) throws SQLException {
0497: return m_rs.relative(arg0);
0498: }
0499:
0500: /* (non-Javadoc)
0501: * @see java.sql.ResultSet#rowDeleted()
0502: */
0503: public boolean rowDeleted() throws SQLException {
0504: return m_rs.rowDeleted();
0505: }
0506:
0507: /* (non-Javadoc)
0508: * @see java.sql.ResultSet#rowInserted()
0509: */
0510: public boolean rowInserted() throws SQLException {
0511: return m_rs.rowInserted();
0512: }
0513:
0514: /* (non-Javadoc)
0515: * @see java.sql.ResultSet#rowUpdated()
0516: */
0517: public boolean rowUpdated() throws SQLException {
0518: return m_rs.rowUpdated();
0519: }
0520:
0521: /* (non-Javadoc)
0522: * @see java.sql.ResultSet#setFetchDirection(int)
0523: */
0524: public void setFetchDirection(int arg0) throws SQLException {
0525: m_rs.setFetchDirection(arg0);
0526: }
0527:
0528: /* (non-Javadoc)
0529: * @see java.sql.ResultSet#setFetchSize(int)
0530: */
0531: public void setFetchSize(int arg0) throws SQLException {
0532: m_rs.setFetchSize(arg0);
0533: }
0534:
0535: /* (non-Javadoc)
0536: * @see java.lang.Object#toString()
0537: */
0538: public String toString() {
0539: return m_rs.toString();
0540: }
0541:
0542: /* (non-Javadoc)
0543: * @see java.sql.ResultSet#updateArray(int, java.sql.Array)
0544: */
0545: public void updateArray(int arg0, Array arg1) throws SQLException {
0546: m_rs.updateArray(arg0, arg1);
0547: }
0548:
0549: /* (non-Javadoc)
0550: * @see java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)
0551: */
0552: public void updateArray(String arg0, Array arg1)
0553: throws SQLException {
0554: m_rs.updateArray(arg0, arg1);
0555: }
0556:
0557: /* (non-Javadoc)
0558: * @see java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)
0559: */
0560: public void updateAsciiStream(int arg0, InputStream arg1, int arg2)
0561: throws SQLException {
0562: m_rs.updateAsciiStream(arg0, arg1, arg2);
0563: }
0564:
0565: /* (non-Javadoc)
0566: * @see java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)
0567: */
0568: public void updateAsciiStream(String arg0, InputStream arg1,
0569: int arg2) throws SQLException {
0570: m_rs.updateAsciiStream(arg0, arg1, arg2);
0571: }
0572:
0573: /* (non-Javadoc)
0574: * @see java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)
0575: */
0576: public void updateBigDecimal(int arg0, BigDecimal arg1)
0577: throws SQLException {
0578: m_rs.updateBigDecimal(arg0, arg1);
0579: }
0580:
0581: /* (non-Javadoc)
0582: * @see java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)
0583: */
0584: public void updateBigDecimal(String arg0, BigDecimal arg1)
0585: throws SQLException {
0586: m_rs.updateBigDecimal(arg0, arg1);
0587: }
0588:
0589: /* (non-Javadoc)
0590: * @see java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)
0591: */
0592: public void updateBinaryStream(int arg0, InputStream arg1, int arg2)
0593: throws SQLException {
0594: m_rs.updateBinaryStream(arg0, arg1, arg2);
0595: }
0596:
0597: /* (non-Javadoc)
0598: * @see java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)
0599: */
0600: public void updateBinaryStream(String arg0, InputStream arg1,
0601: int arg2) throws SQLException {
0602: m_rs.updateBinaryStream(arg0, arg1, arg2);
0603: }
0604:
0605: /* (non-Javadoc)
0606: * @see java.sql.ResultSet#updateBlob(int, java.sql.Blob)
0607: */
0608: public void updateBlob(int arg0, Blob arg1) throws SQLException {
0609: m_rs.updateBlob(arg0, arg1);
0610: }
0611:
0612: /* (non-Javadoc)
0613: * @see java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)
0614: */
0615: public void updateBlob(String arg0, Blob arg1) throws SQLException {
0616: m_rs.updateBlob(arg0, arg1);
0617: }
0618:
0619: /* (non-Javadoc)
0620: * @see java.sql.ResultSet#updateBoolean(int, boolean)
0621: */
0622: public void updateBoolean(int arg0, boolean arg1)
0623: throws SQLException {
0624: m_rs.updateBoolean(arg0, arg1);
0625: }
0626:
0627: /* (non-Javadoc)
0628: * @see java.sql.ResultSet#updateBoolean(java.lang.String, boolean)
0629: */
0630: public void updateBoolean(String arg0, boolean arg1)
0631: throws SQLException {
0632: m_rs.updateBoolean(arg0, arg1);
0633: }
0634:
0635: /* (non-Javadoc)
0636: * @see java.sql.ResultSet#updateByte(int, byte)
0637: */
0638: public void updateByte(int arg0, byte arg1) throws SQLException {
0639: m_rs.updateByte(arg0, arg1);
0640: }
0641:
0642: /* (non-Javadoc)
0643: * @see java.sql.ResultSet#updateByte(java.lang.String, byte)
0644: */
0645: public void updateByte(String arg0, byte arg1) throws SQLException {
0646: m_rs.updateByte(arg0, arg1);
0647: }
0648:
0649: /* (non-Javadoc)
0650: * @see java.sql.ResultSet#updateBytes(int, byte[])
0651: */
0652: public void updateBytes(int arg0, byte[] arg1) throws SQLException {
0653: m_rs.updateBytes(arg0, arg1);
0654: }
0655:
0656: /* (non-Javadoc)
0657: * @see java.sql.ResultSet#updateBytes(java.lang.String, byte[])
0658: */
0659: public void updateBytes(String arg0, byte[] arg1)
0660: throws SQLException {
0661: m_rs.updateBytes(arg0, arg1);
0662: }
0663:
0664: /* (non-Javadoc)
0665: * @see java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)
0666: */
0667: public void updateCharacterStream(int arg0, Reader arg1, int arg2)
0668: throws SQLException {
0669: m_rs.updateCharacterStream(arg0, arg1, arg2);
0670: }
0671:
0672: /* (non-Javadoc)
0673: * @see java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)
0674: */
0675: public void updateCharacterStream(String arg0, Reader arg1, int arg2)
0676: throws SQLException {
0677: m_rs.updateCharacterStream(arg0, arg1, arg2);
0678: }
0679:
0680: /* (non-Javadoc)
0681: * @see java.sql.ResultSet#updateClob(int, java.sql.Clob)
0682: */
0683: public void updateClob(int arg0, Clob arg1) throws SQLException {
0684: m_rs.updateClob(arg0, arg1);
0685: }
0686:
0687: /* (non-Javadoc)
0688: * @see java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)
0689: */
0690: public void updateClob(String arg0, Clob arg1) throws SQLException {
0691: m_rs.updateClob(arg0, arg1);
0692: }
0693:
0694: /* (non-Javadoc)
0695: * @see java.sql.ResultSet#updateDate(int, java.sql.Date)
0696: */
0697: public void updateDate(int arg0, java.sql.Date arg1)
0698: throws SQLException {
0699: m_rs.updateDate(arg0, arg1);
0700: }
0701:
0702: /* (non-Javadoc)
0703: * @see java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)
0704: */
0705: public void updateDate(String arg0, java.sql.Date arg1)
0706: throws SQLException {
0707: m_rs.updateDate(arg0, arg1);
0708: }
0709:
0710: /* (non-Javadoc)
0711: * @see java.sql.ResultSet#updateDouble(int, double)
0712: */
0713: public void updateDouble(int arg0, double arg1) throws SQLException {
0714: m_rs.updateDouble(arg0, arg1);
0715: }
0716:
0717: /* (non-Javadoc)
0718: * @see java.sql.ResultSet#updateDouble(java.lang.String, double)
0719: */
0720: public void updateDouble(String arg0, double arg1)
0721: throws SQLException {
0722: m_rs.updateDouble(arg0, arg1);
0723: }
0724:
0725: /* (non-Javadoc)
0726: * @see java.sql.ResultSet#updateFloat(int, float)
0727: */
0728: public void updateFloat(int arg0, float arg1) throws SQLException {
0729: m_rs.updateFloat(arg0, arg1);
0730: }
0731:
0732: /* (non-Javadoc)
0733: * @see java.sql.ResultSet#updateFloat(java.lang.String, float)
0734: */
0735: public void updateFloat(String arg0, float arg1)
0736: throws SQLException {
0737: m_rs.updateFloat(arg0, arg1);
0738: }
0739:
0740: /* (non-Javadoc)
0741: * @see java.sql.ResultSet#updateInt(int, int)
0742: */
0743: public void updateInt(int arg0, int arg1) throws SQLException {
0744: m_rs.updateInt(arg0, arg1);
0745: }
0746:
0747: /* (non-Javadoc)
0748: * @see java.sql.ResultSet#updateInt(java.lang.String, int)
0749: */
0750: public void updateInt(String arg0, int arg1) throws SQLException {
0751: m_rs.updateInt(arg0, arg1);
0752: }
0753:
0754: /* (non-Javadoc)
0755: * @see java.sql.ResultSet#updateLong(int, long)
0756: */
0757: public void updateLong(int arg0, long arg1) throws SQLException {
0758: m_rs.updateLong(arg0, arg1);
0759: }
0760:
0761: /* (non-Javadoc)
0762: * @see java.sql.ResultSet#updateLong(java.lang.String, long)
0763: */
0764: public void updateLong(String arg0, long arg1) throws SQLException {
0765: m_rs.updateLong(arg0, arg1);
0766: }
0767:
0768: /* (non-Javadoc)
0769: * @see java.sql.ResultSet#updateNull(int)
0770: */
0771: public void updateNull(int arg0) throws SQLException {
0772: m_rs.updateNull(arg0);
0773: }
0774:
0775: /* (non-Javadoc)
0776: * @see java.sql.ResultSet#updateNull(java.lang.String)
0777: */
0778: public void updateNull(String arg0) throws SQLException {
0779: m_rs.updateNull(arg0);
0780: }
0781:
0782: /* (non-Javadoc)
0783: * @see java.sql.ResultSet#updateObject(int, java.lang.Object)
0784: */
0785: public void updateObject(int arg0, Object arg1) throws SQLException {
0786: m_rs.updateObject(arg0, arg1);
0787: }
0788:
0789: /* (non-Javadoc)
0790: * @see java.sql.ResultSet#updateObject(int, java.lang.Object, int)
0791: */
0792: public void updateObject(int arg0, Object arg1, int arg2)
0793: throws SQLException {
0794: m_rs.updateObject(arg0, arg1, arg2);
0795: }
0796:
0797: /* (non-Javadoc)
0798: * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)
0799: */
0800: public void updateObject(String arg0, Object arg1)
0801: throws SQLException {
0802: m_rs.updateObject(arg0, arg1);
0803: }
0804:
0805: /* (non-Javadoc)
0806: * @see java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object, int)
0807: */
0808: public void updateObject(String arg0, Object arg1, int arg2)
0809: throws SQLException {
0810: m_rs.updateObject(arg0, arg1, arg2);
0811: }
0812:
0813: /* (non-Javadoc)
0814: * @see java.sql.ResultSet#updateRef(int, java.sql.Ref)
0815: */
0816: public void updateRef(int arg0, Ref arg1) throws SQLException {
0817: m_rs.updateRef(arg0, arg1);
0818: }
0819:
0820: /* (non-Javadoc)
0821: * @see java.sql.ResultSet#updateRef(java.lang.String, java.sql.Ref)
0822: */
0823: public void updateRef(String arg0, Ref arg1) throws SQLException {
0824: m_rs.updateRef(arg0, arg1);
0825: }
0826:
0827: /* (non-Javadoc)
0828: * @see java.sql.ResultSet#updateRow()
0829: */
0830: public void updateRow() throws SQLException {
0831: m_rs.updateRow();
0832: }
0833:
0834: /* (non-Javadoc)
0835: * @see java.sql.ResultSet#updateShort(int, short)
0836: */
0837: public void updateShort(int arg0, short arg1) throws SQLException {
0838: m_rs.updateShort(arg0, arg1);
0839: }
0840:
0841: /* (non-Javadoc)
0842: * @see java.sql.ResultSet#updateShort(java.lang.String, short)
0843: */
0844: public void updateShort(String arg0, short arg1)
0845: throws SQLException {
0846: m_rs.updateShort(arg0, arg1);
0847: }
0848:
0849: /* (non-Javadoc)
0850: * @see java.sql.ResultSet#updateString(int, java.lang.String)
0851: */
0852: public void updateString(int arg0, String arg1) throws SQLException {
0853: m_rs.updateString(arg0, arg1);
0854: }
0855:
0856: /* (non-Javadoc)
0857: * @see java.sql.ResultSet#updateString(java.lang.String, java.lang.String)
0858: */
0859: public void updateString(String arg0, String arg1)
0860: throws SQLException {
0861: m_rs.updateString(arg0, arg1);
0862: }
0863:
0864: /* (non-Javadoc)
0865: * @see java.sql.ResultSet#updateTime(int, java.sql.Time)
0866: */
0867: public void updateTime(int arg0, Time arg1) throws SQLException {
0868: m_rs.updateTime(arg0, arg1);
0869: }
0870:
0871: /* (non-Javadoc)
0872: * @see java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)
0873: */
0874: public void updateTime(String arg0, Time arg1) throws SQLException {
0875: m_rs.updateTime(arg0, arg1);
0876: }
0877:
0878: /* (non-Javadoc)
0879: * @see java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)
0880: */
0881: public void updateTimestamp(int arg0, Timestamp arg1)
0882: throws SQLException {
0883: m_rs.updateTimestamp(arg0, arg1);
0884: }
0885:
0886: /* (non-Javadoc)
0887: * @see java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)
0888: */
0889: public void updateTimestamp(String arg0, Timestamp arg1)
0890: throws SQLException {
0891: m_rs.updateTimestamp(arg0, arg1);
0892: }
0893:
0894: /* (non-Javadoc)
0895: * @see java.sql.ResultSet#getTimestamp(int)
0896: */
0897: public Timestamp getTimestamp(int arg0) throws SQLException {
0898: return m_rs.getTimestamp(arg0);
0899: }
0900:
0901: /* (non-Javadoc)
0902: * @see java.sql.ResultSet#getBoolean(java.lang.String)
0903: */
0904: public boolean getBoolean(String arg0) throws SQLException {
0905: return m_rs.getBoolean(arg0);
0906: }
0907:
0908: /* (non-Javadoc)
0909: * @see java.sql.ResultSet#getObject(int)
0910: */
0911: public Object getObject(int arg0) throws SQLException {
0912: return m_rs.getObject(arg0);
0913: }
0914:
0915: /* (non-Javadoc)
0916: * @see java.sql.ResultSet#getTime(int)
0917: */
0918: public Time getTime(int arg0) throws SQLException {
0919: return m_rs.getTime(arg0);
0920: }
0921:
0922: /* (non-Javadoc)
0923: * @see java.sql.ResultSet#getBytes(int)
0924: */
0925: public byte[] getBytes(int arg0) throws SQLException {
0926: return m_rs.getBytes(arg0);
0927: }
0928:
0929: /* (non-Javadoc)
0930: * @see java.sql.ResultSet#getBytes(java.lang.String)
0931: */
0932: public byte[] getBytes(String arg0) throws SQLException {
0933: return m_rs.getBytes(arg0);
0934: }
0935:
0936: /* (non-Javadoc)
0937: * @see java.sql.ResultSet#getCursorName()
0938: */
0939: public String getCursorName() throws SQLException {
0940: return m_rs.getCursorName();
0941: }
0942:
0943: /* (non-Javadoc)
0944: * @see java.sql.ResultSet#clearWarnings()
0945: */
0946: public void clearWarnings() throws SQLException {
0947: m_rs.clearWarnings();
0948: }
0949:
0950: /* (non-Javadoc)
0951: * @see java.sql.ResultSet#getUnicodeStream(int)
0952: */
0953: public InputStream getUnicodeStream(int arg0) throws SQLException {
0954: return m_rs.getUnicodeStream(arg0);
0955: }
0956:
0957: /* (non-Javadoc)
0958: * @see java.sql.ResultSet#getLong(java.lang.String)
0959: */
0960: public long getLong(String arg0) throws SQLException {
0961: return m_rs.getLong(arg0);
0962: }
0963:
0964: /* (non-Javadoc)
0965: * @see java.sql.ResultSet#getMetaData()
0966: */
0967: public ResultSetMetaData getMetaData() throws SQLException {
0968: return m_rs.getMetaData();
0969: }
0970:
0971: /* (non-Javadoc)
0972: * @see java.sql.ResultSet#getBigDecimal(int, int)
0973: */
0974: public BigDecimal getBigDecimal(int arg0, int arg1)
0975: throws SQLException {
0976: return m_rs.getBigDecimal(arg0, arg1);
0977: }
0978:
0979: /* (non-Javadoc)
0980: * @see java.sql.ResultSet#getFloat(int)
0981: */
0982: public float getFloat(int arg0) throws SQLException {
0983: return m_rs.getFloat(arg0);
0984: }
0985:
0986: /* (non-Javadoc)
0987: * @see java.sql.ResultSet#findColumn(java.lang.String)
0988: */
0989: public int findColumn(String arg0) throws SQLException {
0990: return m_rs.findColumn(arg0);
0991: }
0992:
0993: /* (non-Javadoc)
0994: * @see java.sql.ResultSet#getBigDecimal(java.lang.String, int)
0995: */
0996: public BigDecimal getBigDecimal(String arg0, int arg1)
0997: throws SQLException {
0998: return m_rs.getBigDecimal(arg0, arg1);
0999: }
1000:
1001: /* (non-Javadoc)
1002: * @see java.sql.ResultSet#getTimestamp(java.lang.String)
1003: */
1004: public Timestamp getTimestamp(String arg0) throws SQLException {
1005: return m_rs.getTimestamp(arg0);
1006: }
1007:
1008: /* (non-Javadoc)
1009: * @see java.sql.ResultSet#getDouble(java.lang.String)
1010: */
1011: public double getDouble(String arg0) throws SQLException {
1012: return m_rs.getDouble(arg0);
1013: }
1014:
1015: /* (non-Javadoc)
1016: * @see java.sql.ResultSet#getInt(java.lang.String)
1017: */
1018: public int getInt(String str) throws SQLException {
1019: String sKey = this .getCacheKey(str);
1020: Integer intResult = null;
1021:
1022: if (m_rowcache.size() > 0) {
1023: intResult = (Integer) m_rowcache.get(sKey);
1024: }
1025:
1026: if (intResult == null) {
1027: intResult = new Integer(m_rs.getInt(str));
1028: if (intResult != null) {
1029: m_rowcache.put(sKey, intResult);
1030: }
1031: }
1032:
1033: return intResult.intValue();
1034: }
1035:
1036: /* (non-Javadoc)
1037: * @see java.sql.ResultSet#getDate(java.lang.String)
1038: */
1039: public java.sql.Date getDate(String arg0) throws SQLException {
1040: return m_rs.getDate(arg0);
1041: }
1042:
1043: /* (non-Javadoc)
1044: * @see java.sql.ResultSet#getTime(java.lang.String)
1045: */
1046: public Time getTime(String arg0) throws SQLException {
1047: return m_rs.getTime(arg0);
1048: }
1049:
1050: /* (non-Javadoc)
1051: * @see java.sql.ResultSet#getShort(java.lang.String)
1052: */
1053: public short getShort(String arg0) throws SQLException {
1054: return m_rs.getShort(arg0);
1055: }
1056:
1057: /* (non-Javadoc)
1058: * @see java.sql.ResultSet#getAsciiStream(java.lang.String)
1059: */
1060: public InputStream getAsciiStream(String arg0) throws SQLException {
1061: return m_rs.getAsciiStream(arg0);
1062: }
1063:
1064: /* (non-Javadoc)
1065: * @see java.sql.ResultSet#wasNull()
1066: */
1067: public boolean wasNull() throws SQLException {
1068: return m_rs.wasNull();
1069: }
1070:
1071: /* (non-Javadoc)
1072: * @see java.sql.ResultSet#getBinaryStream(int)
1073: */
1074: public InputStream getBinaryStream(int arg0) throws SQLException {
1075: return m_rs.getBinaryStream(arg0);
1076: }
1077:
1078: /* (non-Javadoc)
1079: * @see java.sql.ResultSet#getDate(int)
1080: */
1081: public java.sql.Date getDate(int arg0) throws SQLException {
1082: return m_rs.getDate(arg0);
1083: }
1084:
1085: /* (non-Javadoc)
1086: * @see java.sql.ResultSet#getWarnings()
1087: */
1088: public SQLWarning getWarnings() throws SQLException {
1089: return m_rs.getWarnings();
1090: }
1091:
1092: /* (non-Javadoc)
1093: * @see java.sql.ResultSet#getAsciiStream(int)
1094: */
1095: public InputStream getAsciiStream(int arg0) throws SQLException {
1096: return m_rs.getAsciiStream(arg0);
1097: }
1098:
1099: /* (non-Javadoc)
1100: * @see java.sql.ResultSet#getLong(int)
1101: */
1102: public long getLong(int arg0) throws SQLException {
1103: return m_rs.getLong(arg0);
1104: }
1105:
1106: /* (non-Javadoc)
1107: * @see java.sql.ResultSet#getUnicodeStream(java.lang.String)
1108: */
1109: public InputStream getUnicodeStream(String arg0)
1110: throws SQLException {
1111: return m_rs.getUnicodeStream(arg0);
1112: }
1113:
1114: /* (non-Javadoc)
1115: * @see java.sql.ResultSet#getByte(int)
1116: */
1117: public byte getByte(int arg0) throws SQLException {
1118: return m_rs.getByte(arg0);
1119: }
1120:
1121: /* (non-Javadoc)
1122: * @see java.sql.ResultSet#getObject(java.lang.String)
1123: */
1124: public Object getObject(String arg0) throws SQLException {
1125: return m_rs.getObject(arg0);
1126: }
1127:
1128: /* (non-Javadoc)
1129: * @see java.sql.ResultSet#getInt(int)
1130: */
1131: public int getInt(int n) throws SQLException {
1132: String sKey = this .getCacheKey(n);
1133: Integer intResult = null;
1134:
1135: if (m_rowcache.size() > 0) {
1136: intResult = (Integer) m_rowcache.get(sKey);
1137: }
1138:
1139: if (intResult == null) {
1140: intResult = new Integer(m_rs.getInt(n));
1141: if (intResult != null) {
1142: m_rowcache.put(sKey, intResult);
1143: }
1144: }
1145:
1146: return intResult.intValue();
1147: }
1148:
1149: /* (non-Javadoc)
1150: * @see java.sql.ResultSet#getShort(int)
1151: */
1152: public short getShort(int arg0) throws SQLException {
1153: return m_rs.getShort(arg0);
1154: }
1155:
1156: /* (non-Javadoc)
1157: * @see java.sql.ResultSet#getBoolean(int)
1158: */
1159: public boolean getBoolean(int arg0) throws SQLException {
1160: return m_rs.getBoolean(arg0);
1161: }
1162:
1163: /* (non-Javadoc)
1164: * @see java.sql.ResultSet#getFloat(java.lang.String)
1165: */
1166: public float getFloat(String arg0) throws SQLException {
1167: return m_rs.getFloat(arg0);
1168: }
1169:
1170: /* (non-Javadoc)
1171: * @see java.sql.ResultSet#getBinaryStream(java.lang.String)
1172: */
1173: public InputStream getBinaryStream(String arg0) throws SQLException {
1174: return m_rs.getBinaryStream(arg0);
1175: }
1176:
1177: /* (non-Javadoc)
1178: * @see java.sql.ResultSet#getDouble(int)
1179: */
1180: public double getDouble(int arg0) throws SQLException {
1181: return m_rs.getDouble(arg0);
1182: }
1183:
1184: /* (non-Javadoc)
1185: * @see java.sql.ResultSet#getByte(java.lang.String)
1186: */
1187: public byte getByte(String arg0) throws SQLException {
1188: return m_rs.getByte(arg0);
1189: }
1190:
1191: }
|