org.postgresql.jdbc
Class PgResultSetMetaData

java.lang.Object
  extended by org.postgresql.jdbc.PgResultSetMetaData
All Implemented Interfaces:
ResultSetMetaData, Wrapper, PGResultSetMetaData

public class PgResultSetMetaData
extends Object
implements ResultSetMetaData, PGResultSetMetaData


Field Summary
protected  BaseConnection connection
           
protected  Field[] fields
           
 
Fields inherited from interface java.sql.ResultSetMetaData
columnNoNulls, columnNullable, columnNullableUnknown
 
Constructor Summary
PgResultSetMetaData(BaseConnection connection, Field[] fields)
           
 
Method Summary
 String getBaseColumnName(int column)
          Returns the underlying column name of a query result, or "" if it is unable to be determined.
 String getBaseSchemaName(int column)
          Returns the underlying schema name of query result, or "" if it is unable to be determined.
 String getBaseTableName(int column)
          Returns the underlying table name of query result, or "" if it is unable to be determined.
 String getCatalogName(int column)
           
 String getColumnClassName(int column)
          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.
 int getColumnCount()
           
 int getColumnDisplaySize(int column)
           
 String getColumnLabel(int column)
           
 String getColumnName(int column)
           
 int getColumnType(int column)
           
 String getColumnTypeName(int column)
           
protected  Field getField(int columnIndex)
           
 int getFormat(int column)
          Is a column Text or Binary?
protected  String getPGType(int columnIndex)
           
 int getPrecision(int column)
           
 int getScale(int column)
           
 String getSchemaName(int column)
           
protected  int getSQLType(int columnIndex)
           
 String getTableName(int column)
           
 boolean isAutoIncrement(int column)
           
 boolean isCaseSensitive(int column)
           
 boolean isCurrency(int column)
           
 boolean isDefinitelyWritable(int column)
           
 int isNullable(int column)
           
 boolean isReadOnly(int column)
           
 boolean isSearchable(int column)
           
 boolean isSigned(int column)
           
 boolean isWrapperFor(Class<?> iface)
           
 boolean isWritable(int column)
           
<T> T
unwrap(Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 SQLException
Specified by:
getColumnCount in interface ResultSetMetaData
Throws:
SQLException

isAutoIncrement

public boolean isAutoIncrement(int column)
                        throws SQLException
Specified by:
isAutoIncrement in interface ResultSetMetaData
Throws:
SQLException

isCaseSensitive

public boolean isCaseSensitive(int column)
                        throws SQLException
Specified by:
isCaseSensitive in interface ResultSetMetaData
Throws:
SQLException

isSearchable

public boolean isSearchable(int column)
                     throws SQLException
Specified by:
isSearchable in interface ResultSetMetaData
Throws:
SQLException

isCurrency

public boolean isCurrency(int column)
                   throws SQLException
Specified by:
isCurrency in interface ResultSetMetaData
Throws:
SQLException

isNullable

public int isNullable(int column)
               throws SQLException
Specified by:
isNullable in interface ResultSetMetaData
Throws:
SQLException

isSigned

public boolean isSigned(int column)
                 throws SQLException
Specified by:
isSigned in interface ResultSetMetaData
Throws:
SQLException

getColumnDisplaySize

public int getColumnDisplaySize(int column)
                         throws SQLException
Specified by:
getColumnDisplaySize in interface ResultSetMetaData
Throws:
SQLException

getColumnLabel

public String getColumnLabel(int column)
                      throws SQLException
Specified by:
getColumnLabel in interface ResultSetMetaData
Throws:
SQLException

getColumnName

public String getColumnName(int column)
                     throws SQLException
Specified by:
getColumnName in interface ResultSetMetaData
Throws:
SQLException

getBaseColumnName

public String getBaseColumnName(int column)
                         throws SQLException
Description copied from interface: PGResultSetMetaData
Returns the underlying column name of a query result, or "" if it is unable to be determined.

Specified by:
getBaseColumnName in interface PGResultSetMetaData
Parameters:
column - column position (1-based)
Returns:
underlying column name of a query result
Throws:
SQLException - if something wrong happens

getSchemaName

public String getSchemaName(int column)
                     throws SQLException
Specified by:
getSchemaName in interface ResultSetMetaData
Throws:
SQLException

getBaseSchemaName

public String getBaseSchemaName(int column)
                         throws SQLException
Description copied from interface: PGResultSetMetaData
Returns the underlying schema name of query result, or "" if it is unable to be determined.

Specified by:
getBaseSchemaName in interface PGResultSetMetaData
Parameters:
column - column position (1-based)
Returns:
underlying schema name of query result
Throws:
SQLException - if something wrong happens

getPrecision

public int getPrecision(int column)
                 throws SQLException
Specified by:
getPrecision in interface ResultSetMetaData
Throws:
SQLException

getScale

public int getScale(int column)
             throws SQLException
Specified by:
getScale in interface ResultSetMetaData
Throws:
SQLException

getTableName

public String getTableName(int column)
                    throws SQLException
Specified by:
getTableName in interface ResultSetMetaData
Throws:
SQLException

getBaseTableName

public String getBaseTableName(int column)
                        throws SQLException
Description copied from interface: PGResultSetMetaData
Returns the underlying table name of query result, or "" if it is unable to be determined.

Specified by:
getBaseTableName in interface PGResultSetMetaData
Parameters:
column - column position (1-based)
Returns:
underlying table name of query result
Throws:
SQLException - if something wrong happens

getCatalogName

public String getCatalogName(int column)
                      throws SQLException
Specified by:
getCatalogName in interface ResultSetMetaData
Throws:
SQLException

getColumnType

public int getColumnType(int column)
                  throws SQLException
Specified by:
getColumnType in interface ResultSetMetaData
Throws:
SQLException

getFormat

public int getFormat(int column)
              throws SQLException
Description copied from interface: PGResultSetMetaData
Is a column Text or Binary?

Specified by:
getFormat in interface PGResultSetMetaData
Parameters:
column - column position (1-based)
Returns:
if column is Text or Binary
Throws:
SQLException - if something wrong happens
See Also:
Field.BINARY_FORMAT, Field.TEXT_FORMAT

getColumnTypeName

public String getColumnTypeName(int column)
                         throws SQLException
Specified by:
getColumnTypeName in interface ResultSetMetaData
Throws:
SQLException

isReadOnly

public boolean isReadOnly(int column)
                   throws SQLException
Specified by:
isReadOnly in interface ResultSetMetaData
Throws:
SQLException

isWritable

public boolean isWritable(int column)
                   throws SQLException
Specified by:
isWritable in interface ResultSetMetaData
Throws:
SQLException

isDefinitelyWritable

public boolean isDefinitelyWritable(int column)
                             throws SQLException
Specified by:
isDefinitelyWritable in interface ResultSetMetaData
Throws:
SQLException

getField

protected Field getField(int columnIndex)
                  throws SQLException
Throws:
SQLException

getPGType

protected String getPGType(int columnIndex)
                    throws SQLException
Throws:
SQLException

getSQLType

protected int getSQLType(int columnIndex)
                  throws SQLException
Throws:
SQLException

getColumnClassName

public 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 interface 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.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

isWrapperFor

public boolean isWrapperFor(Class<?> iface)
                     throws SQLException
Specified by:
isWrapperFor in interface Wrapper
Throws:
SQLException

unwrap

public <T> T unwrap(Class<T> iface)
         throws SQLException
Specified by:
unwrap in interface Wrapper
Throws:
SQLException


Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.