Package org.postgresql.jdbc
Class PgResultSetMetaData
- java.lang.Object
-
- org.postgresql.jdbc.PgResultSetMetaData
-
- All Implemented Interfaces:
java.sql.ResultSetMetaData,java.sql.Wrapper,PGResultSetMetaData
public class PgResultSetMetaData extends java.lang.Object implements java.sql.ResultSetMetaData, PGResultSetMetaData
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseConnectionconnectionprotected Field[]fields
-
Constructor Summary
Constructors Constructor Description PgResultSetMetaData(BaseConnection connection, Field[] fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseColumnName(int column)Returns the underlying column name of a query result, or "" if it is unable to be determined.java.lang.StringgetBaseSchemaName(int column)Returns the underlying schema name of query result, or "" if it is unable to be determined.java.lang.StringgetBaseTableName(int column)Returns the underlying table name of query result, or "" if it is unable to be determined.java.lang.StringgetCatalogName(int column)java.lang.StringgetColumnClassName(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.intgetColumnCount()intgetColumnDisplaySize(int column)java.lang.StringgetColumnLabel(int column)java.lang.StringgetColumnName(int column)intgetColumnType(int column)java.lang.StringgetColumnTypeName(int column)protected FieldgetField(int columnIndex)intgetFormat(int column)Is a column Text or Binary?protected java.lang.StringgetPGType(int columnIndex)intgetPrecision(int column)intgetScale(int column)java.lang.StringgetSchemaName(int column)protected intgetSQLType(int columnIndex)java.lang.StringgetTableName(int column)booleanisAutoIncrement(int column)booleanisCaseSensitive(int column)booleanisCurrency(int column)booleanisDefinitelyWritable(int column)intisNullable(int column)booleanisReadOnly(int column)booleanisSearchable(int column)booleanisSigned(int column)booleanisWrapperFor(java.lang.Class<?> iface)booleanisWritable(int column)<T> Tunwrap(java.lang.Class<T> iface)
-
-
-
Field Detail
-
connection
protected final BaseConnection connection
-
fields
protected final Field[] fields
-
-
Constructor Detail
-
PgResultSetMetaData
public PgResultSetMetaData(BaseConnection connection, Field[] fields)
-
-
Method Detail
-
getColumnCount
public int getColumnCount() throws java.sql.SQLException- Specified by:
getColumnCountin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isAutoIncrement
public boolean isAutoIncrement(int column) throws java.sql.SQLException- Specified by:
isAutoIncrementin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isCaseSensitive
public boolean isCaseSensitive(int column) throws java.sql.SQLException- Specified by:
isCaseSensitivein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isSearchable
public boolean isSearchable(int column) throws java.sql.SQLException- Specified by:
isSearchablein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isCurrency
public boolean isCurrency(int column) throws java.sql.SQLException- Specified by:
isCurrencyin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isNullable
public int isNullable(int column) throws java.sql.SQLException- Specified by:
isNullablein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isSigned
public boolean isSigned(int column) throws java.sql.SQLException- Specified by:
isSignedin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getColumnDisplaySize
public int getColumnDisplaySize(int column) throws java.sql.SQLException- Specified by:
getColumnDisplaySizein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getColumnLabel
public java.lang.String getColumnLabel(int column) throws java.sql.SQLException- Specified by:
getColumnLabelin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getColumnName
public java.lang.String getColumnName(int column) throws java.sql.SQLException- Specified by:
getColumnNamein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getBaseColumnName
public java.lang.String getBaseColumnName(int column) throws java.sql.SQLExceptionDescription copied from interface:PGResultSetMetaDataReturns the underlying column name of a query result, or "" if it is unable to be determined.- Specified by:
getBaseColumnNamein interfacePGResultSetMetaData- Parameters:
column- column position (1-based)- Returns:
- underlying column name of a query result
- Throws:
java.sql.SQLException- if something wrong happens
-
getSchemaName
public java.lang.String getSchemaName(int column) throws java.sql.SQLException- Specified by:
getSchemaNamein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getBaseSchemaName
public java.lang.String getBaseSchemaName(int column) throws java.sql.SQLExceptionDescription copied from interface:PGResultSetMetaDataReturns the underlying schema name of query result, or "" if it is unable to be determined.- Specified by:
getBaseSchemaNamein interfacePGResultSetMetaData- Parameters:
column- column position (1-based)- Returns:
- underlying schema name of query result
- Throws:
java.sql.SQLException- if something wrong happens
-
getPrecision
public int getPrecision(int column) throws java.sql.SQLException- Specified by:
getPrecisionin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getScale
public int getScale(int column) throws java.sql.SQLException- Specified by:
getScalein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getTableName
public java.lang.String getTableName(int column) throws java.sql.SQLException- Specified by:
getTableNamein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getBaseTableName
public java.lang.String getBaseTableName(int column) throws java.sql.SQLExceptionDescription copied from interface:PGResultSetMetaDataReturns the underlying table name of query result, or "" if it is unable to be determined.- Specified by:
getBaseTableNamein interfacePGResultSetMetaData- Parameters:
column- column position (1-based)- Returns:
- underlying table name of query result
- Throws:
java.sql.SQLException- if something wrong happens
-
getCatalogName
public java.lang.String getCatalogName(int column) throws java.sql.SQLException- Specified by:
getCatalogNamein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getColumnType
public int getColumnType(int column) throws java.sql.SQLException- Specified by:
getColumnTypein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getFormat
public int getFormat(int column) throws java.sql.SQLExceptionDescription copied from interface:PGResultSetMetaDataIs a column Text or Binary?- Specified by:
getFormatin interfacePGResultSetMetaData- Parameters:
column- column position (1-based)- Returns:
- if column is Text or Binary
- Throws:
java.sql.SQLException- if something wrong happens- See Also:
Field.BINARY_FORMAT,Field.TEXT_FORMAT
-
getColumnTypeName
public java.lang.String getColumnTypeName(int column) throws java.sql.SQLException- Specified by:
getColumnTypeNamein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isReadOnly
public boolean isReadOnly(int column) throws java.sql.SQLException- Specified by:
isReadOnlyin interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isWritable
public boolean isWritable(int column) throws java.sql.SQLException- Specified by:
isWritablein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
isDefinitelyWritable
public boolean isDefinitelyWritable(int column) throws java.sql.SQLException- Specified by:
isDefinitelyWritablein interfacejava.sql.ResultSetMetaData- Throws:
java.sql.SQLException
-
getField
protected Field getField(int columnIndex) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getPGType
protected java.lang.String getPGType(int columnIndex) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getSQLType
protected int getSQLType(int columnIndex) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getColumnClassName
public java.lang.String getColumnClassName(int column) throws java.sql.SQLExceptionReturns the fully-qualified name of the Java class whose instances are manufactured if the methodResultSet.getObjectis called to retrieve a value from the column.ResultSet.getObjectmay return a subclass of the class returned by this method.- Specified by:
getColumnClassNamein interfacejava.sql.ResultSetMetaData- 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.getObjectto retrieve the value in the specified column. This is the class name used for custom mapping. - Throws:
java.sql.SQLException- if a database access error occurs
-
isWrapperFor
public boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
unwrap
public <T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException- Specified by:
unwrapin interfacejava.sql.Wrapper- Throws:
java.sql.SQLException
-
-