- java.lang.Object
-
- org.postgresql.pljava.jdbc.AbstractResultSetMetaData
-
- org.postgresql.pljava.jdbc.SPIResultSetMetaData
-
- All Implemented Interfaces:
ResultSetMetaData
,Wrapper
public class SPIResultSetMetaData extends AbstractResultSetMetaData
Implementation of ResultSetMetaData for SPIResultSet- Author:
- Filip Hrbek
-
-
Field Summary
-
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
-
-
Constructor Summary
Constructors Constructor Description SPIResultSetMetaData(TupleDesc tupleDesc)
Constructor.
-
Method Summary
Modifier and Type Method Description protected void
checkColumnIndex(int column)
Checks if the column index is valid.String
getColumnClassName(int column)
Returns the fully-qualified name of the Java class whose instances are manufactured if the methodResultSet.getObject
is called to retrieve a value from the column.int
getColumnCount()
Returns the number of columns in thisResultSet
object.String
getColumnLabel(int column)
Gets the designated column's suggested title for use in printouts and displays.protected int
getFieldLength(int column)
Gets column length.protected Oid
getOid(int column)
Gets column OIDboolean
isAutoIncrement(int column)
Indicates whether the designated column is automatically numbered, thus read-only.-
Methods inherited from class org.postgresql.pljava.jdbc.AbstractResultSetMetaData
getCatalogName, getColumnDisplaySize, getColumnName, getColumnType, getColumnTypeName, getPrecision, getScale, getSchemaName, getTableName, isCaseSensitive, isCurrency, isDefinitelyWritable, isNullable, isReadOnly, isSearchable, isSigned, isWrapperFor, isWritable, unwrap
-
-
-
-
Constructor Detail
-
SPIResultSetMetaData
public SPIResultSetMetaData(TupleDesc tupleDesc)
Constructor.- Parameters:
tupleDesc
- The descriptor for the ResultSet tuples
-
-
Method Detail
-
getColumnCount
public final int getColumnCount() throws SQLException
Returns the number of columns in thisResultSet
object.- Specified by:
getColumnCount
in interfaceResultSetMetaData
- Specified by:
getColumnCount
in classAbstractResultSetMetaData
- Returns:
- the number of columns
- Throws:
SQLException
- if a database access error occurs
-
isAutoIncrement
public final boolean isAutoIncrement(int column) throws SQLException
Indicates whether the designated column is automatically numbered, thus read-only.- Specified by:
isAutoIncrement
in interfaceResultSetMetaData
- Specified by:
isAutoIncrement
in classAbstractResultSetMetaData
- Parameters:
column
- the first column is 1, the second is 2, ...- Returns:
true
if so;false
otherwise- Throws:
SQLException
- if a database access error occurs
-
getColumnLabel
public final String getColumnLabel(int column) throws SQLException
Gets the designated column's suggested title for use in printouts and displays.- Specified by:
getColumnLabel
in interfaceResultSetMetaData
- Specified by:
getColumnLabel
in classAbstractResultSetMetaData
- Parameters:
column
- the first column is 1, the second is 2, ...- Returns:
- the suggested column title
- Throws:
SQLException
- if a database access error occurs
-
getColumnClassName
public final String getColumnClassName(int column) throws SQLException
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.ResultSet.getObject
may return a subclass of the class returned by this method.- Specified by:
getColumnClassName
in interfaceResultSetMetaData
- Specified by:
getColumnClassName
in classAbstractResultSetMetaData
- Parameters:
column
- the first column is 1, the second is 2, ...- Returns:
- 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. - Throws:
SQLException
- if a database access error occurs- Since:
- 1.2
-
checkColumnIndex
protected final void checkColumnIndex(int column) throws SQLException
Checks if the column index is valid.- Specified by:
checkColumnIndex
in classAbstractResultSetMetaData
- Parameters:
column
- the first column is 1, the second is 2, ...- Throws:
SQLException
- if the column is out of index bounds
-
getOid
protected final Oid getOid(int column) throws SQLException
Gets column OID- Specified by:
getOid
in classAbstractResultSetMetaData
- Parameters:
column
- Column index- Returns:
- column OID
- Throws:
SQLException
- if an error occurs
-
getFieldLength
protected final int getFieldLength(int column) throws SQLException
Gets column length. This method is called if the AbstractResultSet does not know how to get column length according to type OID. We retutn 0 because we don't know the proper length either.- Specified by:
getFieldLength
in classAbstractResultSetMetaData
- Parameters:
column
- Column index- Returns:
- column length
- Throws:
SQLException
- if an error occurs
-
-