|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.driver.Field
Field is our private implementation of ResultSetMetaData
,
holding the information for one column.
The first version was inspired from the MM MySQL driver by Mark Matthews.
DriverResultSet
,
ControllerResultSet
,
Serialized FormField 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(CJDBCInputStream in)
Creates a new Field object, deserializing it from an input
stream. |
|
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()
Returns the Java class used by the mapping. |
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 JDBC type code. |
java.lang.String |
getTableName()
Gets the table name. |
java.lang.String |
getTypeName()
Returns the SQL type name used by the database. |
boolean |
isAutoIncrement()
|
boolean |
isCaseSensitive()
|
boolean |
isCurrency()
|
boolean |
isDefinitelyWritable()
|
int |
isNullable()
|
boolean |
isReadOnly()
|
boolean |
isSearchable()
|
boolean |
isSigned()
|
boolean |
isWritable()
|
void |
sendToStream(CJDBCOutputStream out)
Serialize the Field on the output stream by sending only the
needed parameters to reconstruct it on the controller. |
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 |
private java.lang.String tableName
private java.lang.String fieldName
private int columnDisplaySize
private int sqlType
private java.lang.String typeName
private java.lang.String columnClassName
private boolean isAutoIncrement
private boolean isCaseSensitive
private boolean isCurrency
private int isNullable
private boolean isReadOnly
private boolean isWritable
private boolean isDefinitelyWritable
private boolean isSearchable
private boolean isSigned
private int precision
private int scale
Constructor Detail |
public Field(java.lang.String table, java.lang.String name, int columnDisplaySize, int sqlType, java.lang.String typeName, java.lang.String columnClassName)
table
- the table namename
- the field namecolumnDisplaySize
- the column display sizesqlType
- the SQL typetypeName
- the type namecolumnClassName
- the column class namepublic 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)
Field
instance.
table
- the table namename
- the field namecolumnDisplaySize
- the column display sizesqlType
- the SQL typetypeName
- the type namecolumnClassName
- the column class nameisAutoIncrement
- true if field is auto incrementedisCaseSensitive
- true if field is case sensitiveisCurrency
- true if field is currencyisNullable
- indicates the nullability of the fieldisReadOnly
- true if field is read onlyisWritable
- true if field is writableisDefinitelyWritable
- true if field is definetly writableisSearchable
- true if field is searchableisSigned
- true if field is signedprecision
- decimal precisionscale
- number of digits to right of decimal pointpublic Field(CJDBCInputStream in) throws java.io.IOException
Field
object, deserializing it from an input
stream. Has to mirror the serialization method below.
in
- input stream
java.io.IOException
- if a stream error occursMethod Detail |
public void sendToStream(CJDBCOutputStream out) throws java.io.IOException
Field
on the output stream by sending only the
needed parameters to reconstruct it on the controller. Has to mirror the
deserialization method above.
out
- destination stream
java.io.IOException
- if a stream error occurspublic java.lang.String getTableName()
String
valuepublic java.lang.String getFieldName()
String
valuesetFieldName(java.lang.String)
public java.lang.String getFullName()
String
valuepublic void setFieldName(java.lang.String name)
name
- the new field namegetFieldName()
public java.lang.String toString()
String
valuegetFullName()
public int getSqlType()
Types
ResultSetMetaData.getColumnType(int)
public java.lang.String getTypeName()
ResultSetMetaData.getColumnTypeName(int)
public java.lang.String getColumnClassName()
ResultSetMetaData.getColumnClassName(int)
public int getColumnDisplaySize()
ResultSetMetaData.getColumnDisplaySize(int)
public boolean isAutoIncrement()
ResultSetMetaData.isAutoIncrement(int)
public boolean isCaseSensitive()
ResultSetMetaData.isCaseSensitive(int)
public boolean isCurrency()
ResultSetMetaData.isCurrency(int)
public boolean isDefinitelyWritable()
ResultSetMetaData.isDefinitelyWritable(int)
public int isNullable()
ResultSetMetaData.isNullable(int)
public boolean isReadOnly()
ResultSetMetaData.isReadOnly(int)
public boolean isWritable()
ResultSetMetaData.isWritable(int)
public boolean isSearchable()
ResultSetMetaData.isSearchable(int)
public boolean isSigned()
ResultSetMetaData.isSigned(int)
public int getPrecision()
ResultSetMetaData.getPrecision(int)
public int getScale()
ResultSetMetaData.getScale(int)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |