Class VTIMetaDataTemplate
java.lang.Object
org.apache.derby.vti.VTIMetaDataTemplate
- All Implemented Interfaces:
ResultSetMetaData, Wrapper
- Direct Known Subclasses:
ImportResultSetMetaData
An abstract implementation of ResultSetMetaData (JDBC 1.2) that is useful
when writing a VTI (virtual table interface).
This class implements
most of the methods of ResultSetMetaData, 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.
For virtual tables the database engine only calls methods defined in the JDBC 1.2 definition of java.sql.ResultSetMetaData.
Classes that implement a JDBC 2.0 conformant java.sql.ResultSetMetaData can be used as the meta data for virtual tables.
Developers can use the VTIMetaDataTemplate20 instead of this class when developing in a Java 2 environment.
The methods not implemented here are
- getColumnCount()
- getColumnType()
For virtual tables the database engine only calls methods defined in the JDBC 1.2 definition of java.sql.ResultSetMetaData.
Classes that implement a JDBC 2.0 conformant java.sql.ResultSetMetaData can be used as the meta data for virtual tables.
Developers can use the VTIMetaDataTemplate20 instead of this class when developing in a Java 2 environment.
-
Field Summary
Fields inherited from interface ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCatalogName(int column) What's a column's table's catalog name?getColumnClassName(int column) Returns the fully-qualified name of the Java class whose instances are manufactured if the methodResultSet.getObjectis called to retrieve a value from the column.intgetColumnDisplaySize(int column) What's the column's normal maximum width in chars?getColumnLabel(int column) What's the suggested column title for use in printouts and displays?getColumnName(int column) What's a column's name?getColumnTypeName(int column) What's a column's data source specific type name?intgetPrecision(int column) How many decimal digits are in the column?intgetScale(int column) What's a column's number of digits to the right of the decimal point?getSchemaName(int column) What's a column's table's schema?getTableName(int column) What's a column's table name?booleanisAutoIncrement(int column) Is the column automatically numbered, and thus read-only?booleanisCaseSensitive(int column) Does a column's case matter?booleanisCurrency(int column) Is the column a cash value?booleanisDefinitelyWritable(int column) Will a write on the column definitely succeed?intisNullable(int column) Can you put a NULL in this column?booleanisReadOnly(int column) Is a column definitely not writable?booleanisSearchable(int column) Can the column be used in a WHERE clause?booleanisSigned(int column) Is the column a signed number?booleanisWrapperFor(Class<?> iface) booleanisWritable(int column) Is it possible for a write on the column to succeed?protected SQLExceptionnotImplemented(String methodName) Create a SQLException saying that the calling method is not implemented.<T> TMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSetMetaData
getColumnCount, getColumnType
-
Constructor Details
-
VTIMetaDataTemplate
public VTIMetaDataTemplate()
-
-
Method Details
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isAutoIncrement
Is the column automatically numbered, and thus read-only?- Specified by:
isAutoIncrementin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if the column is automatically numbered
- Throws:
SQLException- if a database-access error occurs.
-
isCaseSensitive
Does a column's case matter?- Specified by:
isCaseSensitivein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if the column is case-sensitive
- Throws:
SQLException- if a database-access error occurs.
-
isSearchable
Can the column be used in a WHERE clause?- Specified by:
isSearchablein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if the column is searchable
- Throws:
SQLException- if a database-access error occurs.
-
isCurrency
Is the column a cash value?- Specified by:
isCurrencyin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if the column is a cash value
- Throws:
SQLException- if a database-access error occurs.
-
isNullable
Can you put a NULL in this column?- Specified by:
isNullablein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- columnNoNulls, columnNullable or columnNullableUnknown
- Throws:
SQLException- if a database-access error occurs.
-
isSigned
Is the column a signed number?- Specified by:
isSignedin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if the column is a signed number
- Throws:
SQLException- if a database-access error occurs.
-
getColumnDisplaySize
What's the column's normal maximum width in chars?- Specified by:
getColumnDisplaySizein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's maximum width
- Throws:
SQLException- if a database-access error occurs.
-
getColumnLabel
What's the suggested column title for use in printouts and displays?- Specified by:
getColumnLabelin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's title
- Throws:
SQLException- if a database-access error occurs.
-
getColumnName
What's a column's name?- Specified by:
getColumnNamein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- column name
- Throws:
SQLException- if a database-access error occurs.
-
getSchemaName
What's a column's table's schema?- Specified by:
getSchemaNamein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- schema name or "" if not applicable
- Throws:
SQLException- if a database-access error occurs.
-
getPrecision
How many decimal digits are in the column?- Specified by:
getPrecisionin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's precision
- Throws:
SQLException- if a database-access error occurs.
-
getScale
What's a column's number of digits to the right of the decimal point?- Specified by:
getScalein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's scale
- Throws:
SQLException- if a database-access error occurs.
-
getTableName
What's a column's table name?- Specified by:
getTableNamein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's table name or "" if not applicable
- Throws:
SQLException- if a database-access error occurs.
-
getCatalogName
What's a column's table's catalog name?- Specified by:
getCatalogNamein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's table's catalog name or "" if not applicable.
- Throws:
SQLException- if a database-access error occurs.
-
getColumnTypeName
What's a column's data source specific type name?- Specified by:
getColumnTypeNamein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- the column's type name
- Throws:
SQLException- if a database-access error occurs.
-
isReadOnly
Is a column definitely not writable?- Specified by:
isReadOnlyin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true - vti's are read only false - column is not read-only
- Throws:
SQLException- if a database-access error occurs.
-
isWritable
Is it possible for a write on the column to succeed?- Specified by:
isWritablein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if column is possibly writable
- Throws:
SQLException- if a database-access error occurs.
-
isDefinitelyWritable
Will a write on the column definitely succeed?- Specified by:
isDefinitelyWritablein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if column is definitely writable
- Throws:
SQLException- if a database-access error occurs.
-
getColumnClassName
Returns the fully-qualified name of the Java class whose instances are manufactured if the methodResultSet.getObjectis called to retrieve a value from the column. JDBC 2.0.- Specified by:
getColumnClassNamein interfaceResultSetMetaData- Throws:
SQLException- if a database-access error occurs
-
notImplemented
Create a SQLException saying that the calling method is not implemented.
-