Top Description Constructors Methods
org.apache.derby.vti

public abstract Class VTIMetaDataTemplate

extends Object
implements ResultSetMetaData
Class Inheritance
All Implemented Interfaces
java.sql.ResultSetMetaData, java.sql.Wrapper
Known Direct Subclasses
org.apache.derby.impl.load.ImportResultSetMetaData
Imports
java.sql.SQLException, .SQLFeatureNotSupportedException, .ResultSetMetaData

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.

The methods not implemented here are


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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the column's table's catalog name or "" if not applicable.
getCatalogName
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getCatalogName.

What's a column's table's catalog name?

public String
getColumnClassName(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getColumnClassName.

Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.

public int

Returns:

the column's maximum width
getColumnDisplaySize
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getColumnDisplaySize.

What's the column's normal maximum width in chars?

public String

Returns:

the column's title
getColumnLabel
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getColumnLabel.

What's the suggested column title for use in printouts and displays?

public String

Returns:

column name
getColumnName
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getColumnName.

What's a column's name?

public String

Returns:

the column's type name
getColumnTypeName
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getColumnTypeName.

What's a column's data source specific type name?

public int

Returns:

the column's precision
getPrecision
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getPrecision.

How many decimal digits are in the column?

public int

Returns:

the column's scale
getScale
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getScale.

What's a column's number of digits to the right of the decimal point?

public String

Returns:

schema name or "" if not applicable
getSchemaName
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getSchemaName.

What's a column's table's schema?

public String

Returns:

the column's table name or "" if not applicable
getTableName
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.getTableName.

What's a column's table name?

public boolean

Returns:

true if the column is automatically numbered
isAutoIncrement
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isAutoIncrement.

Is the column automatically numbered, and thus read-only?

public boolean

Returns:

true if the column is case-sensitive
isCaseSensitive
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isCaseSensitive.

Does a column's case matter?

public boolean

Returns:

true if the column is a cash value
isCurrency
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isCurrency.

Is the column a cash value?

public boolean

Returns:

true if column is definitely writable
isDefinitelyWritable
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isDefinitelyWritable.

Will a write on the column definitely succeed?

public int

Returns:

columnNoNulls, columnNullable or columnNullableUnknown
isNullable
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isNullable.

Can you put a NULL in this column?

public boolean

Returns:

true - vti's are read only false - column is not read-only
isReadOnly
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isReadOnly.

Is a column definitely not writable?

public boolean

Returns:

true if the column is searchable
isSearchable
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isSearchable.

Can the column be used in a WHERE clause?

public boolean

Returns:

true if the column is a signed number
isSigned
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isSigned.

Is the column a signed number?

public boolean
isWrapperFor(Class<?>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.

public boolean

Returns:

true if column is possibly writable
isWritable
(int
the first column is 1, the second is 2, ...
column
)

Implements java.sql.ResultSetMetaData.isWritable.

Is it possible for a write on the column to succeed?

protected SQLException

Returns:

a SQLFeatureNotSupportedException
notImplemented
(String
The name of the unimplemented method
methodName
)

Create a SQLException saying that the calling method is not implemented.

public <T> T
unwrap(Class<T>
A Class defining an interface that the result must implement.
iface
)

Implements java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

VTIMetaDataTemplateback to summary
public VTIMetaDataTemplate()

Method Detail

getCatalogNameback to summary
public String getCatalogName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getCatalogName.

What's a column's table's catalog name?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

the column's table's catalog name or "" if not applicable.

Exceptions
SQLException:
if a database-access error occurs.
getColumnClassNameback to summary
public String getColumnClassName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnClassName.

Returns the fully-qualified name of the Java class whose instances are manufactured if the method ResultSet.getObject is called to retrieve a value from the column. JDBC 2.0.

Parameters
column:int

Doc from java.sql.ResultSetMetaData.getColumnClassName.

the first column is 1, the second is 2, ...

Returns:String

Doc from java.sql.ResultSetMetaData.getColumnClassName.

the fully-qualified name of the class in the Java programming language that would be used by the method ResultSet.getObject to retrieve the value in the specified column. This is the class name used for custom mapping.

Exceptions
SQLException:
if a database-access error occurs
getColumnDisplaySizeback to summary
public int getColumnDisplaySize(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnDisplaySize.

What's the column's normal maximum width in chars?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:int

the column's maximum width

Exceptions
SQLException:
if a database-access error occurs.
getColumnLabelback to summary
public String getColumnLabel(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnLabel.

What's the suggested column title for use in printouts and displays?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

the column's title

Exceptions
SQLException:
if a database-access error occurs.
getColumnNameback to summary
public String getColumnName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnName.

What's a column's name?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

column name

Exceptions
SQLException:
if a database-access error occurs.
getColumnTypeNameback to summary
public String getColumnTypeName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getColumnTypeName.

What's a column's data source specific type name?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

the column's type name

Exceptions
SQLException:
if a database-access error occurs.
getPrecisionback to summary
public int getPrecision(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getPrecision.

How many decimal digits are in the column?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:int

the column's precision

Exceptions
SQLException:
if a database-access error occurs.
getScaleback to summary
public int getScale(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getScale.

What's a column's number of digits to the right of the decimal point?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:int

the column's scale

Exceptions
SQLException:
if a database-access error occurs.
getSchemaNameback to summary
public String getSchemaName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getSchemaName.

What's a column's table's schema?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

schema name or "" if not applicable

Exceptions
SQLException:
if a database-access error occurs.
getTableNameback to summary
public String getTableName(int column) throws SQLException

Implements java.sql.ResultSetMetaData.getTableName.

What's a column's table name?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:String

the column's table name or "" if not applicable

Exceptions
SQLException:
if a database-access error occurs.
isAutoIncrementback to summary
public boolean isAutoIncrement(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isAutoIncrement.

Is the column automatically numbered, and thus read-only?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if the column is automatically numbered

Exceptions
SQLException:
if a database-access error occurs.
isCaseSensitiveback to summary
public boolean isCaseSensitive(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isCaseSensitive.

Does a column's case matter?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if the column is case-sensitive

Exceptions
SQLException:
if a database-access error occurs.
isCurrencyback to summary
public boolean isCurrency(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isCurrency.

Is the column a cash value?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if the column is a cash value

Exceptions
SQLException:
if a database-access error occurs.
isDefinitelyWritableback to summary
public boolean isDefinitelyWritable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isDefinitelyWritable.

Will a write on the column definitely succeed?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if column is definitely writable

Exceptions
SQLException:
if a database-access error occurs.
isNullableback to summary
public int isNullable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isNullable.

Can you put a NULL in this column?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:int

columnNoNulls, columnNullable or columnNullableUnknown

Exceptions
SQLException:
if a database-access error occurs.
isReadOnlyback to summary
public boolean isReadOnly(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isReadOnly.

Is a column definitely not writable?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true - vti's are read only false - column is not read-only

Exceptions
SQLException:
if a database-access error occurs.
isSearchableback to summary
public boolean isSearchable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isSearchable.

Can the column be used in a WHERE clause?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if the column is searchable

Exceptions
SQLException:
if a database-access error occurs.
isSignedback to summary
public boolean isSigned(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isSigned.

Is the column a signed number?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if the column is a signed number

Exceptions
SQLException:
if a database-access error occurs.
isWrapperForback to summary
public boolean isWrapperFor(Class<?> iface) throws SQLException

Implements java.sql.Wrapper.isWrapperFor.

Doc from java.sql.Wrapper.isWrapperFor.

Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.

Parameters
iface:Class<?>

a Class defining an interface.

Returns:boolean

true if this implements the interface or directly or indirectly wraps an object that does.

Exceptions
SQLException:
if an error occurs while determining whether this is a wrapper for an object with the given interface.
isWritableback to summary
public boolean isWritable(int column) throws SQLException

Implements java.sql.ResultSetMetaData.isWritable.

Is it possible for a write on the column to succeed?

Parameters
column:int

the first column is 1, the second is 2, ...

Returns:boolean

true if column is possibly writable

Exceptions
SQLException:
if a database-access error occurs.
notImplementedback to summary
protected SQLException notImplemented(String methodName)

Create a SQLException saying that the calling method is not implemented.

Parameters
methodName:String

The name of the unimplemented method

Returns:SQLException

a SQLFeatureNotSupportedException

unwrapback to summary
public <T> T unwrap(Class<T> iface) throws SQLException

Implements java.sql.Wrapper.unwrap.

Doc from java.sql.Wrapper.unwrap.

Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.

Parameters
<T>
the type of the class modeled by this Class object
iface:Class<T>

A Class defining an interface that the result must implement.

Returns:T

an object that implements the interface. May be a proxy for the actual implementing object.

Exceptions
SQLException:
If no object found that implements the interface