/* * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sockslib.utils.jdbc; import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; import java.sql.Array; import java.sql.Clob; import java.sql.Date; import java.sql.NClob; import java.sql.Ref; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.RowId; import java.sql.SQLException; import java.sql.SQLXML; import java.sql.Time; import java.sql.Timestamp; import java.util.Calendar; import java.util.Map; /** * The class <code>ReadOnlyResultSet</code> is a wrapper for {@link java.sql.ResultSet}. * This is class is read only. * * @author Youchao Feng * @version 1.0 * @date Sep 08, 2015 */ public final class ReadOnlyResultSet { private ResultSet resultSet; public ReadOnlyResultSet(ResultSet resultSet) { this.resultSet = resultSet; } public String getString(int columnIndex) throws SQLException { return resultSet.getString(columnIndex); } public String getString(String columnLabel) throws SQLException { return resultSet.getString(columnLabel); } public String getNString(int columnIndex) throws SQLException { return resultSet.getNString(columnIndex); } public String getNString(String columnLabel) throws SQLException { return resultSet.getNString(columnLabel); } public Array getArray(int columnIndex) throws SQLException { return resultSet.getArray(columnIndex); } public Array getArray(String columnLabel) throws SQLException { return resultSet.getArray(columnLabel); } public int getInt(int columnIndex) throws SQLException { return resultSet.getInt(columnIndex); } public int getInt(String columnLabel) throws SQLException { return resultSet.getInt(columnLabel); } public long getLong(int columnIndex) throws SQLException { return resultSet.getLong(columnIndex); } public long getLong(String columnLabel) throws SQLException { return resultSet.getLong(columnLabel); } public byte getByte(int columnIndex) throws SQLException { return resultSet.getByte(columnIndex); } public byte getByte(String columnLabel) throws SQLException { return resultSet.getByte(columnLabel); } public float getFloat(int columnIndex) throws SQLException { return resultSet.getFloat(columnIndex); } public float getFloat(String columnLabel) throws SQLException { return resultSet.getFloat(columnLabel); } public double getDouble(int columnIndex) throws SQLException { return resultSet.getDouble(columnIndex); } public double getDouble(String columnLabel) throws SQLException { return resultSet.getDouble(columnLabel); } public short getShort(int columnIndex) throws SQLException { return resultSet.getShort(columnIndex); } public short getShort(String columnLabel) throws SQLException { return resultSet.getShort(columnLabel); } public Date getDate(int columnIndex) throws SQLException { return resultSet.getDate(columnIndex); } public Date getDate(int columnIndex, Calendar cal) throws SQLException { return resultSet.getDate(columnIndex, cal); } public Date getDate(String columnLabel) throws SQLException { return resultSet.getDate(columnLabel); } public Date getDate(String columnLabel, Calendar cal) throws SQLException { return resultSet.getDate(columnLabel, cal); } public boolean getBoolean(int columnIndex) throws SQLException { return resultSet.getBoolean(columnIndex); } public boolean getBoolean(String columnLabel) throws SQLException { return resultSet.getBoolean(columnLabel); } public BigDecimal getBigDecimal(int columnIndex) throws SQLException { return resultSet.getBigDecimal(columnIndex); } public BigDecimal getBigDecimal(String columnLabel) throws SQLException { return resultSet.getBigDecimal(columnLabel); } public byte[] getBytes(int columnIndex) throws SQLException { return resultSet.getBytes(columnIndex); } public byte[] getBytes(String columnLabel) throws SQLException { return resultSet.getBytes(columnLabel); } public Time getTime(int columnIndex) throws SQLException { return resultSet.getTime(columnIndex); } public Time getTime(int columnIndex, Calendar cal) throws SQLException { return resultSet.getTime(columnIndex, cal); } public Time getTime(String columnLabel) throws SQLException { return resultSet.getTime(columnLabel); } public Time getTime(String columnLabel, Calendar cal) throws SQLException { return resultSet.getTime(columnLabel, cal); } public Timestamp getTimestamp(int columnIndex) throws SQLException { return resultSet.getTimestamp(columnIndex); } public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { return resultSet.getTimestamp(columnIndex, cal); } public Timestamp getTimestamp(String columnLabel) throws SQLException { return resultSet.getTimestamp(columnLabel); } public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { return resultSet.getTimestamp(columnLabel, cal); } public URL getURL(int columnIndex) throws SQLException { return resultSet.getURL(columnIndex); } public URL getURL(String columnLabel) throws SQLException { return resultSet.getURL(columnLabel); } public Clob getClob(int columnIndex) throws SQLException { return resultSet.getClob(columnIndex); } public Clob getClob(String columnLabel) throws SQLException { return resultSet.getClob(columnLabel); } public Ref getRef(int columnIndex) throws SQLException { return resultSet.getRef(columnIndex); } public Ref getRef(String columnLabel) throws SQLException { return resultSet.getRef(columnLabel); } public InputStream getAsciiStream(int columnIndex) throws SQLException { return resultSet.getAsciiStream(columnIndex); } public InputStream getAsciiStream(String columnLabel) throws SQLException { return resultSet.getAsciiStream(columnLabel); } public NClob getNClob(int columnIndex) throws SQLException { return resultSet.getNClob(columnIndex); } public NClob getNClob(String columnLabel) throws SQLException { return resultSet.getNClob(columnLabel); } public InputStream getBinaryStream(int columnIndex) throws SQLException { return resultSet.getBinaryStream(columnIndex); } public InputStream getBinaryStream(String columnLabel) throws SQLException { return resultSet.getBinaryStream(columnLabel); } public Reader getCharacterStream(int columnIndex) throws SQLException { return resultSet.getCharacterStream(columnIndex); } public Reader getCharacterStream(String columnLabel) throws SQLException { return resultSet.getCharacterStream(columnLabel); } public Reader getNCharacterStream(int columnIndex) throws SQLException { return resultSet.getNCharacterStream(columnIndex); } public Reader getNCharacterStream(String columnLabel) throws SQLException { return resultSet.getNCharacterStream(columnLabel); } public RowId getRowId(int columnIndex) throws SQLException { return resultSet.getRowId(columnIndex); } public RowId getRowId(String columnLabel) throws SQLException { return resultSet.getRowId(columnLabel); } public SQLXML getSQLXML(int columnIndex) throws SQLException { return resultSet.getSQLXML(columnIndex); } public SQLXML getSQLXML(String columnLabel) throws SQLException { return resultSet.getSQLXML(columnLabel); } public Object getObject(int columnIndex) throws SQLException { return resultSet.getObject(columnIndex); } public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException { return resultSet.getObject(columnIndex, map); } public Object getObject(String columnLabel) throws SQLException { return resultSet.getObject(columnLabel); } public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException { return resultSet.getObject(columnLabel, map); } public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { return resultSet.getObject(columnIndex, type); } public <T> T getObject(String columnLabel, Class<T> type) throws SQLException { return resultSet.getObject(columnLabel, type); } public ResultSetMetaData getMetaData() throws SQLException { return resultSet.getMetaData(); } public int getRow() throws SQLException { return resultSet.getRow(); } }