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
-
length
-
-
name
-
-
oid
-
-
sql_type
-
-
type_name
-
-
Field(Connection, String, int, int)
- Construct a field based on the information fed to it.
-
getOID()
-
-
getSQLType()
- the ResultSet and ResultMetaData both need to handle the SQL
type, which is gained from another query.
-
getSQLType(String)
- This returns the SQL type.
-
getTypeName()
- We also need to get the type name as returned by the back end.
length
public int length
oid
public int oid
name
public String name
sql_type
public int sql_type
type_name
public String type_name
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
getOID
public int getOID()
- Returns:
- the oid of this Field's data type
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
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
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