org.yajul.sql
Class ColumnMetaData

java.lang.Object
  extended by org.yajul.sql.ColumnMetaData
All Implemented Interfaces:
java.io.Serializable

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

Bean that encapsulates database column metadata.
User: jdavis Date: Aug 4, 2003 Time: 6:05:02 PM

Author:
jdavis
See Also:
Serialized Form

Constructor Summary
ColumnMetaData(java.lang.String name, java.lang.String tableName, java.sql.ResultSet rs)
          Creates column meta data from the column name, table name, and result set positioned at the proper column.
 
Method Summary
 int getColumnSize()
          Returns the column size.
 short getDataType()
          Returns the column data type (see java.sql.Types).
 java.lang.String getDataTypeName()
          Returns the name of the data type.
 java.lang.String getName()
          Returns the name of the column.
 int getNullable()
          Returns the nullalbe attribute of the column.
 java.lang.String getTableName()
          Returns the table name that the column is in.
 boolean isIntType()
          Returns true if the column is a type compatible with 'int'.
static boolean isIntType(int dataType)
          Returns true if the column is a type compatible with 'int'.
 boolean isStringType()
          Returns true if the column is a type compatible with 'String'.
static boolean isStringType(int dataType)
          Returns true if the column is a type compatible with 'String'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnMetaData

public ColumnMetaData(java.lang.String name,
                      java.lang.String tableName,
                      java.sql.ResultSet rs)
               throws java.sql.SQLException
Creates column meta data from the column name, table name, and result set positioned at the proper column.

Parameters:
name - The name of the column.
tableName - The name of the table the column is in.
rs - The result set containing the rest of the information.
Throws:
java.sql.SQLException - If there is a problem reading the meta data result set.
Method Detail

getName

public java.lang.String getName()
Returns the name of the column.

Returns:
String - The name of the column.

getTableName

public java.lang.String getTableName()
Returns the table name that the column is in.

Returns:
String - The name of the table.

getDataType

public short getDataType()
Returns the column data type (see java.sql.Types).

Returns:
int - The column data type.
See Also:
Types

getDataTypeName

public java.lang.String getDataTypeName()
Returns the name of the data type.

Returns:
Sring - The name of the datatype.

getColumnSize

public int getColumnSize()
Returns the column size.

Returns:
int - The number of bytes in the column.

getNullable

public int getNullable()
Returns the nullalbe attribute of the column.

Returns:
int - Nullable attribute.

isIntType

public boolean isIntType()
Returns true if the column is a type compatible with 'int'.

Returns:
boolean - True if the column is an int-compatible column.

isStringType

public boolean isStringType()
Returns true if the column is a type compatible with 'String'.

Returns:
boolean - True if the column is a String-compatible column.

isIntType

public static boolean isIntType(int dataType)
Returns true if the column is a type compatible with 'int'.

Parameters:
dataType - The data type (see java.sql.Types)
Returns:
boolean - True if the column is an int-compatible column.
See Also:
Types

isStringType

public static boolean isStringType(int dataType)
Returns true if the column is a type compatible with 'String'.

Parameters:
dataType - The data type (see java.sql.Types)
Returns:
boolean - True if the column is a String-compatible column.
See Also:
Types


Copyright © 2008. All Rights Reserved.