Class EmbedResultSetMetaData
- All Implemented Interfaces:
ResultSetMetaData, Wrapper
We take the (Derby) ResultDescription and examine it, to return the appropriate information.
This class can be used outside of this package to convert a ResultDescription into a ResultSetMetaData object.
EmbedResultSetMetaData objects are shared across multiple threads by being stored in the ResultDescription for a compiled plan. If the required api for ResultSetMetaData ever changes so that it has a close() method, a getConnection() method or any other Connection or ResultSet specific method then this sharing must be removed.
-
Field Summary
FieldsFields inherited from interface ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetCatalogName(int column) What's a column's table's catalog name?final StringgetColumnClassName(int column) JDBC 2.0final intWhat's the number of columns in the ResultSet?final intgetColumnDisplaySize(int column) What's the column's normal max width in chars?final StringgetColumnLabel(int column) What's the suggested column title for use in printouts and displays?final StringgetColumnName(int column) What's a column's name?final intgetColumnType(int column) What's a column's SQL type?private DataTypeDescriptorgetColumnTypeDescriptor(int column) final StringgetColumnTypeName(int column) What's a column's data source specific type name?final intgetPrecision(int column) What's a column's number of decimal digits?static ResultColumnDescriptorgetResultColumnDescriptor(String name, int jdcbTypeId, boolean nullable) static ResultColumnDescriptorgetResultColumnDescriptor(String name, int jdcbTypeId, boolean nullable, int length) static ResultColumnDescriptorgetResultColumnDescriptor(String name, DataTypeDescriptor dtd) final intgetScale(int column) What's a column's number of digits to right of the decimal point?final StringgetSchemaName(int column) What's a column's table's schema?final StringgetTableName(int column) What's a column's table name?final booleanisAutoIncrement(int column) Is the column automatically numbered, thus read-only?final booleanisCaseSensitive(int column) Does a column's case matter?final booleanisCurrency(int column) Is the column a cash value?final booleanisDefinitelyWritable(int column) Will a write on the column definitely succeed?final intisNullable(int column) Can you put a NULL in this column?final booleanisReadOnly(int column) Is a column definitely not writable?final booleanisSearchable(int column) Can the column be used in a where clause?final booleanisSigned(int column) Is the column a signed number?final booleanisWrapperFor(Class<?> iface) Returns whether or not this instance implements the specified interface.final booleanisWritable(int column) Is it possible for a write on the column to succeed?final <T> TReturnsthisif this class implements the interface.private voidvalidColumnNumber(int column)
-
Field Details
-
columnInfo
-
-
Constructor Details
-
EmbedResultSetMetaData
-
-
Method Details
-
getColumnCount
public final int getColumnCount()What's the number of columns in the ResultSet?- Specified by:
getColumnCountin interfaceResultSetMetaData- Returns:
- the number
-
isAutoIncrement
Is the column automatically numbered, thus read-only?- Specified by:
isAutoIncrementin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if so
- Throws:
SQLException- thrown on failure
-
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 so
- Throws:
SQLException- thrown on failure
-
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 so
- Throws:
SQLException- thrown on failure
-
isCurrency
Is the column a cash value? Always returns false since there are no currency data types in Derby.- Specified by:
isCurrencyin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- false, always
- Throws:
SQLException- thrown on failure
-
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- thrown on failure
-
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 so
- Throws:
SQLException- thrown on failure
-
getColumnDisplaySize
What's the column's normal max width in chars?- Specified by:
getColumnDisplaySizein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- max width
- Throws:
SQLException- thrown on failure
-
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:
- true if so
- Throws:
SQLException- thrown on failure
-
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- thrown on failure
-
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- thrown on failure
-
getPrecision
What's a column's number of decimal digits?- Specified by:
getPrecisionin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- precision
- Throws:
SQLException- thrown on failure
-
getScale
What's a column's number of digits to right of the decimal point?- Specified by:
getScalein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- scale
- Throws:
SQLException- thrown on failure
-
getTableName
What's a column's table name?- Specified by:
getTableNamein interfaceResultSetMetaData- Returns:
- table name or "" if not applicable
- Throws:
SQLException- thrown on failure
-
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:
- column name or "" if not applicable.
- Throws:
SQLException- thrown on failure
-
getColumnType
What's a column's SQL type?- Specified by:
getColumnTypein interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- SQL type
- Throws:
SQLException- thrown on failure- See Also:
-
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:
- type name
- Throws:
SQLException- thrown on failure
-
isReadOnly
Is a column definitely not writable?- Specified by:
isReadOnlyin interfaceResultSetMetaData- Parameters:
column- the first column is 1, the second is 2, ...- Returns:
- true if so
- Throws:
SQLException- thrown on failure
-
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 so
- Throws:
SQLException- thrown on failure
-
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 so
- Throws:
SQLException- thrown on failure
-
validColumnNumber
- Throws:
SQLException
-
getColumnTypeDescriptor
- Throws:
SQLException
-
getColumnClassName
JDBC 2.0Return the fully qualified name of the Java class whose instances are manufactured if ResultSet.getObject() is called to retrieve a value from the column. ResultSet.getObject() may return a subClass of the class returned by this method.
- Specified by:
getColumnClassNamein interfaceResultSetMetaData- Throws:
SQLException- Feature not inplemented for now.
-
getResultColumnDescriptor
public static ResultColumnDescriptor getResultColumnDescriptor(String name, int jdcbTypeId, boolean nullable) -
getResultColumnDescriptor
public static ResultColumnDescriptor getResultColumnDescriptor(String name, int jdcbTypeId, boolean nullable, int length) -
getResultColumnDescriptor
-
isWrapperFor
Returns whether or not this instance implements the specified interface.- Specified by:
isWrapperForin interfaceWrapper- Parameters:
iface- the interface to check for- Returns:
- true if this implements the interface
-
unwrap
Returnsthisif this class implements the interface.- Specified by:
unwrapin interfaceWrapper- Parameters:
iface- the interface- Returns:
- an object that implements the interface
- Throws:
SQLException- if no object is found that implements the interface
-