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