All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class postgresql.Field

java.lang.Object
   |
   +----postgresql.Field

public class Field
extends Object
postgresql.Field is a class used to describe fields in a PostgreSQL ResultSet


Variable Index

 o length
 o name
 o oid
 o sql_type
 o type_name

Constructor Index

 o Field(Connection, String, int, int)
Construct a field based on the information fed to it.

Method Index

 o getOID()
 o getSQLType()
the ResultSet and ResultMetaData both need to handle the SQL type, which is gained from another query.
 o getSQLType(String)
This returns the SQL type.
 o getTypeName()
We also need to get the type name as returned by the back end.

Variables

 o length
 public int length
 o oid
 public int oid
 o name
 public String name
 o sql_type
 public int sql_type
 o type_name
 public String type_name

Constructors

 o Field
 public Field(Connection conn,
              String name,
              int oid,
              int length)
Construct a field based on the information fed to it.

Parameters:
conn - the connection this field came from
name - the name of the field
oid - the OID of the field
len - the length of the field

Methods

 o getOID
 public int getOID()
Returns:
the oid of this Field's data type
 o getSQLType
 public int getSQLType() throws SQLException
the ResultSet and ResultMetaData both need to handle the SQL type, which is gained from another query. Note that we cannot use getObject() in this, since getObject uses getSQLType().

Returns:
the entry in Types that refers to this field
Throws: SQLException
if a database access error occurs
 o getSQLType
 public static int getSQLType(String type_name)
This returns the SQL type. It is called by the Field and DatabaseMetaData classes

Parameters:
type_name - PostgreSQL type name
Returns:
java.sql.Types value for oid
 o getTypeName
 public String getTypeName() throws SQLException
We also need to get the type name as returned by the back end. This is held in type_name AFTER a call to getSQLType. Since we get this information within getSQLType (if it isn't already done), we can just call getSQLType and throw away the result.

Returns:
the String representation of the type of this field
Throws: SQLException
if a database access error occurs

All Packages  Class Hierarchy  This Package  Previous  Next  Index