org.objectweb.cjdbc.driver
Class Field

java.lang.Object
  extended byorg.objectweb.cjdbc.driver.Field
All Implemented Interfaces:
java.io.Serializable

public class Field
extends java.lang.Object
implements java.io.Serializable

Field is a class used to describe fields in a ResultSet.

For instance, this is just a dirty copy/paste from the MySQL driver by Mark Matthews ! Implementation has to be completly checked and revised.

Version:
1.0
Author:
Emmanuel Cecchet, Nicolas Modrzyk *
See Also:
ResultSet, Serialized Form

Field Summary
private  java.lang.String columnClassName
           
private  int columnDisplaySize
           
private  java.lang.String fieldName
           
private  boolean isAutoIncrement
           
private  boolean isCaseSensitive
           
private  boolean isCurrency
           
private  boolean isDefinitelyWritable
           
private  int isNullable
           
private  boolean isReadOnly
           
private  boolean isSearchable
           
private  boolean isSigned
           
private  boolean isWritable
           
private  int precision
           
private  int scale
           
private  int sqlType
           
private  java.lang.String tableName
           
private  java.lang.String typeName
           
 
Constructor Summary
Field(java.lang.String table, java.lang.String name, int columnDisplaySize, int sqlType, java.lang.String typeName, java.lang.String columnClassName)
          Create a new field with some default common values.
Field(java.lang.String table, java.lang.String name, int columnDisplaySize, int sqlType, java.lang.String typeName, java.lang.String columnClassName, boolean isAutoIncrement, boolean isCaseSensitive, boolean isCurrency, int isNullable, boolean isReadOnly, boolean isWritable, boolean isDefinitelyWritable, boolean isSearchable, boolean isSigned, int precision, int scale)
          Creates a new Field instance.
 
Method Summary
 java.lang.String getColumnClassName()
           
 int getColumnDisplaySize()
           
 java.lang.String getFieldName()
          Gets the field name.
 java.lang.String getFullName()
          Gets the full name: "tableName.fieldName"
 int getPrecision()
           
 int getScale()
           
 int getSqlType()
          Returns the SQL type.
 java.lang.String getTableName()
          Gets the table name.
 java.lang.String getTypeName()
          Returns the SQL type name.
 boolean isAutoIncrement()
           
 boolean isCaseSensitive()
           
 boolean isCurrency()
           
 boolean isDefinitelyWritable()
           
 int isNullable()
           
 boolean isReadOnly()
           
 boolean isSearchable()
           
 boolean isSigned()
           
 boolean isWritable()
           
 void setFieldName(java.lang.String name)
          Sets the field name.
 java.lang.String toString()
          Returns the full name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scale

private int scale

precision

private int precision

isSigned

private boolean isSigned

isSearchable

private boolean isSearchable

isDefinitelyWritable

private boolean isDefinitelyWritable

isWritable

private boolean isWritable

isReadOnly

private boolean isReadOnly

isNullable

private int isNullable

isCurrency

private boolean isCurrency

isCaseSensitive

private boolean isCaseSensitive

isAutoIncrement

private boolean isAutoIncrement

tableName

private java.lang.String tableName

fieldName

private java.lang.String fieldName

columnDisplaySize

private int columnDisplaySize

sqlType

private int sqlType

typeName

private java.lang.String typeName

columnClassName

private java.lang.String columnClassName
Constructor Detail

Field

public Field(java.lang.String table,
             java.lang.String name,
             int columnDisplaySize,
             int sqlType,
             java.lang.String typeName,
             java.lang.String columnClassName)
Create a new field with some default common values.

Parameters:
table - the table name
name - the field name
columnDisplaySize - the column display size
sqlType - the SQL type
typeName - the type name
columnClassName - the column class name

Field

public Field(java.lang.String table,
             java.lang.String name,
             int columnDisplaySize,
             int sqlType,
             java.lang.String typeName,
             java.lang.String columnClassName,
             boolean isAutoIncrement,
             boolean isCaseSensitive,
             boolean isCurrency,
             int isNullable,
             boolean isReadOnly,
             boolean isWritable,
             boolean isDefinitelyWritable,
             boolean isSearchable,
             boolean isSigned,
             int precision,
             int scale)
Creates a new Field instance.

Parameters:
table - the table name
name - the field name
columnDisplaySize - the column display size
sqlType - the SQL type
typeName - the type name
columnClassName - the column class name
isAutoIncrement - true if field is auto incremented
isCaseSensitive - true if field is case sensitive
isCurrency - true if field is currency
isNullable - indicates the nullability of the field
isReadOnly - true if field is read only
isWritable - true if field is writable
isDefinitelyWritable - true if field is definetly writable
isSearchable - true if field is searchable
isSigned - true if field is signed
precision - decimal precision
scale - number of digits to right of decimal point
Method Detail

getTableName

public java.lang.String getTableName()
Gets the table name.

Returns:
a String value

getFieldName

public java.lang.String getFieldName()
Gets the field name.

Returns:
a String value
See Also:
setFieldName(java.lang.String)

getFullName

public java.lang.String getFullName()
Gets the full name: "tableName.fieldName"

Returns:
a String value

setFieldName

public void setFieldName(java.lang.String name)
Sets the field name.

Parameters:
name - the new field name
See Also:
getFieldName()

toString

public java.lang.String toString()
Returns the full name.

Returns:
String value
See Also:
getFullName()

getSqlType

public int getSqlType()
Returns the SQL type.

Returns:
int Type according to java.sql.Types
See Also:
Types

getTypeName

public java.lang.String getTypeName()
Returns the SQL type name.

Returns:
the SQL type name

getColumnClassName

public java.lang.String getColumnClassName()
See Also:
ResultSetMetaData.getColumnClassName(int)

getColumnDisplaySize

public int getColumnDisplaySize()
See Also:
ResultSetMetaData.getColumnDisplaySize(int)

isAutoIncrement

public boolean isAutoIncrement()
See Also:
ResultSetMetaData.isAutoIncrement(int)

isCaseSensitive

public boolean isCaseSensitive()
See Also:
ResultSetMetaData.isCaseSensitive(int)

isCurrency

public boolean isCurrency()
See Also:
ResultSetMetaData.isCurrency(int)

isDefinitelyWritable

public boolean isDefinitelyWritable()
See Also:
ResultSetMetaData.isDefinitelyWritable(int)

isNullable

public int isNullable()
See Also:
ResultSetMetaData.isNullable(int)

isReadOnly

public boolean isReadOnly()
See Also:
ResultSetMetaData.isReadOnly(int)

isWritable

public boolean isWritable()
See Also:
ResultSetMetaData.isWritable(int)

isSearchable

public boolean isSearchable()
See Also:
ResultSetMetaData.isSearchable(int)

isSigned

public boolean isSigned()
See Also:
ResultSetMetaData.isSigned(int)

getPrecision

public int getPrecision()
See Also:
ResultSetMetaData.getPrecision(int)

getScale

public int getScale()
See Also:
ResultSetMetaData.getScale(int)


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.