resultsetwrapper.java

来自「RESIN 3.2 最新源码」· Java 代码 · 共 2,041 行 · 第 1/3 页

JAVA
2,041
字号
/* * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved * * This file is part of Resin(R) Open Source * * Each copy or derived work must preserve the copyright notice and this * notice unmodified. * * Resin Open Source is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Resin Open Source is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty * of NON-INFRINGEMENT.  See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License * along with Resin Open Source; if not, write to the *   Free SoftwareFoundation, Inc. *   59 Temple Place, Suite 330 *   Boston, MA 02111-1307  USA * * @author Sam */package com.caucho.tools.profiler;import java.io.InputStream;import java.io.Reader;import java.math.BigDecimal;import java.net.URL;import java.sql.*;import java.util.Calendar;import java.util.Map;public final class ResultSetWrapper  implements ResultSet{  private final ProfilerPoint _profilerPoint;  private final ResultSet _resultSet;  public ResultSetWrapper(ProfilerPoint profilerPoint, ResultSet resultSet)  {    _profilerPoint = profilerPoint;    _resultSet = resultSet;  }  public boolean next()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.next();    }    finally {      profiler.finish();    }  }  public void close()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      _resultSet.close();    }    finally {      profiler.finish();    }  }  public boolean wasNull()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.wasNull();    }    finally {      profiler.finish();    }  }  public String getString(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getString(columnIndex);    }    finally {      profiler.finish();    }  }  public boolean getBoolean(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBoolean(columnIndex);    }    finally {      profiler.finish();    }  }  public byte getByte(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getByte(columnIndex);    }    finally {      profiler.finish();    }  }  public short getShort(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getShort(columnIndex);    }    finally {      profiler.finish();    }  }  public int getInt(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getInt(columnIndex);    }    finally {      profiler.finish();    }  }  public long getLong(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getLong(columnIndex);    }    finally {      profiler.finish();    }  }  public float getFloat(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getFloat(columnIndex);    }    finally {      profiler.finish();    }  }  public double getDouble(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getDouble(columnIndex);    }    finally {      profiler.finish();    }  }  public BigDecimal getBigDecimal(int columnIndex, int scale)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBigDecimal(columnIndex, scale);    }    finally {      profiler.finish();    }  }  public byte[] getBytes(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBytes(columnIndex);    }    finally {      profiler.finish();    }  }  public Date getDate(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getDate(columnIndex);    }    finally {      profiler.finish();    }  }  public Time getTime(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getTime(columnIndex);    }    finally {      profiler.finish();    }  }  public Timestamp getTimestamp(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getTimestamp(columnIndex);    }    finally {      profiler.finish();    }  }  public InputStream getAsciiStream(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getAsciiStream(columnIndex);    }    finally {      profiler.finish();    }  }  /**   * @deprecated   */  public InputStream getUnicodeStream(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getUnicodeStream(columnIndex);    }    finally {      profiler.finish();    }  }  public InputStream getBinaryStream(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBinaryStream(columnIndex);    }    finally {      profiler.finish();    }  }  public String getString(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getString(columnName);    }    finally {      profiler.finish();    }  }  public boolean getBoolean(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBoolean(columnName);    }    finally {      profiler.finish();    }  }  public byte getByte(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getByte(columnName);    }    finally {      profiler.finish();    }  }  public short getShort(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getShort(columnName);    }    finally {      profiler.finish();    }  }  public int getInt(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getInt(columnName);    }    finally {      profiler.finish();    }  }  public long getLong(String columnName)    throws SQLException  {    return _resultSet.getLong(columnName);  }  public float getFloat(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getFloat(columnName);    }    finally {      profiler.finish();    }  }  public double getDouble(String columnName)    throws SQLException  {    return _resultSet.getDouble(columnName);  }  public BigDecimal getBigDecimal(String columnName, int scale)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBigDecimal(columnName, scale);    }    finally {      profiler.finish();    }  }  public byte[] getBytes(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBytes(columnName);    }    finally {      profiler.finish();    }  }  public Date getDate(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getDate(columnName);    }    finally {      profiler.finish();    }  }  public Time getTime(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getTime(columnName);    }    finally {      profiler.finish();    }  }  public Timestamp getTimestamp(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getTimestamp(columnName);    }    finally {      profiler.finish();    }  }  public InputStream getAsciiStream(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getAsciiStream(columnName);    }    finally {      profiler.finish();    }  }  public InputStream getUnicodeStream(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getUnicodeStream(columnName);    }    finally {      profiler.finish();    }  }  public InputStream getBinaryStream(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBinaryStream(columnName);    }    finally {      profiler.finish();    }  }  public SQLWarning getWarnings()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getWarnings();    }    finally {      profiler.finish();    }  }  public void clearWarnings()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      _resultSet.clearWarnings();    }    finally {      profiler.finish();    }  }  public String getCursorName()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getCursorName();    }    finally {      profiler.finish();    }  }  public ResultSetMetaData getMetaData()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getMetaData();    }    finally {      profiler.finish();    }  }  public Object getObject(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getObject(columnIndex);    }    finally {      profiler.finish();    }  }  public Object getObject(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getObject(columnName);    }    finally {      profiler.finish();    }  }  public int findColumn(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.findColumn(columnName);    }    finally {      profiler.finish();    }  }  public Reader getCharacterStream(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getCharacterStream(columnIndex);    }    finally {      profiler.finish();    }  }  public Reader getCharacterStream(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getCharacterStream(columnName);    }    finally {      profiler.finish();    }  }  public BigDecimal getBigDecimal(int columnIndex)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBigDecimal(columnIndex);    }    finally {      profiler.finish();    }  }  public BigDecimal getBigDecimal(String columnName)    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.getBigDecimal(columnName);    }    finally {      profiler.finish();    }  }  public boolean isBeforeFirst()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.isBeforeFirst();    }    finally {      profiler.finish();    }  }  public boolean isAfterLast()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.isAfterLast();    }    finally {      profiler.finish();    }  }  public boolean isFirst()    throws SQLException  {    Profiler profiler = _profilerPoint.start();    try {      return _resultSet.isFirst();    }    finally {      profiler.finish();    }  }  public boolean isLast()    throws SQLException  {    Profiler profiler = _profilerPoint.start();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?