📄 vtitemplate.java
字号:
/* Derby - Class org.apache.derbyDemo.vtis.core.VTITemplate Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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 org.apache.derbyDemo.vtis.core;import java.sql.Connection;import java.sql.Statement;import java.sql.ResultSet;import java.sql.ResultSetMetaData;import java.sql.SQLException;import java.sql.SQLWarning;import java.math.BigDecimal;import java.net.URL;import java.util.Calendar;import java.sql.Ref;import java.sql.Blob;import java.sql.Clob;import java.sql.Array;/** An abstract implementation of ResultSet (JDK1.1/JDBC 1.2) that is useful when writing a read-only VTI (virtual table interface) or for the ResultSet returned by executeQuery in read-write VTI classes. This class implements most of the methods of the JDBC 1.2 interface java.sql.ResultSet, each one throwing a SQLException with the name of the method. A concrete subclass can then just implement the methods not implemented here and override any methods it needs to implement for correct functionality. <P> The methods not implemented here are <UL> <LI>next() <LI>close() <LI>getMetaData() </UL> <P> For virtual tables the database engine only calls methods defined in the JDBC 1.2 definition of java.sql.ResultSet. <BR> Classes that implement a JDBC 2.0 conformant java.sql.ResultSet can be used as virtual tables. */public abstract class VTITemplate implements ResultSet { // // java.sql.ResultSet calls, passed through to our result set. // /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public boolean wasNull() throws SQLException { throw new SQLException("wasNull"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public String getString(int columnIndex) throws SQLException { throw new SQLException("getString"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public boolean getBoolean(int columnIndex) throws SQLException { throw new SQLException("getBoolean"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public byte getByte(int columnIndex) throws SQLException { throw new SQLException("getByte"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public short getShort(int columnIndex) throws SQLException { throw new SQLException("getShort"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public int getInt(int columnIndex) throws SQLException { throw new SQLException("getInt"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public long getLong(int columnIndex) throws SQLException { throw new SQLException("getLong"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public float getFloat(int columnIndex) throws SQLException { throw new SQLException("getFloat"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public double getDouble(int columnIndex) throws SQLException { throw new SQLException("getDouble"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { throw new SQLException("getBigDecimal"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public byte[] getBytes(int columnIndex) throws SQLException { throw new SQLException("getBytes"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Date getDate(int columnIndex) throws SQLException { throw new SQLException("getDate"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Time getTime(int columnIndex) throws SQLException { throw new SQLException("getTime"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { throw new SQLException("getTimestamp"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { throw new SQLException("getAsciiStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { throw new SQLException("getUnicodeStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { throw new SQLException("getBinaryStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public String getString(String columnName) throws SQLException { return getString(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public boolean getBoolean(String columnName) throws SQLException { return getBoolean(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public byte getByte(String columnName) throws SQLException { return getByte(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public short getShort(String columnName) throws SQLException { return getShort(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public int getInt(String columnName) throws SQLException { return getInt(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public long getLong(String columnName) throws SQLException { return getLong(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public float getFloat(String columnName) throws SQLException { return getFloat(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public double getDouble(String columnName) throws SQLException { return getDouble(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { return getBigDecimal(findColumn(columnName), scale); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public byte[] getBytes(String columnName) throws SQLException { return getBytes(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Date getDate(String columnName) throws SQLException { return getDate(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Time getTime(String columnName) throws SQLException { return getTime(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { return getTimestamp(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getAsciiStream(String columnName) throws SQLException { throw new SQLException("getAsciiStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { throw new SQLException("getUnicodeStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.InputStream getBinaryStream(String columnName) throws SQLException { throw new SQLException("getBinaryStream"); } /** * @exception SQLException if there is an error */ public SQLWarning getWarnings() throws SQLException { return null; } /** * @exception SQLException if there is an error */ public void clearWarnings() throws SQLException { } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public String getCursorName() throws SQLException { throw new SQLException("getCursorName"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public Object getObject(int columnIndex) throws SQLException { throw new SQLException("getObject"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public Object getObject(String columnName) throws SQLException { return getObject(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public int findColumn(String columnName) throws SQLException { throw new SQLException("findColumn"); } /* ** JDBC 2.0 methods */ /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { throw new SQLException("getCharacterStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public java.io.Reader getCharacterStream(String columnName) throws SQLException { throw new SQLException("getCharacterStream"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public BigDecimal getBigDecimal(int columnIndex) throws SQLException { throw new SQLException("getBigDecimal"); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public BigDecimal getBigDecimal(String columnName) throws SQLException { return getBigDecimal(findColumn(columnName)); } /** * @see java.sql.ResultSet * * @exception SQLException on unexpected JDBC error */ public boolean isBeforeFirst() throws SQLException { throw new SQLException("isBeforeFirst"); } /**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -