org.clazzes.jdbc2xml.schema
Class ColumnInfo
java.lang.Object
org.clazzes.jdbc2xml.schema.ColumnInfo
public class ColumnInfo
- extends java.lang.Object
This class holds metadata of a database column.
- Author:
- wglas
|
Constructor Summary |
ColumnInfo(org.xml.sax.Attributes atts)
|
ColumnInfo(java.sql.ResultSetMetaData md,
int column)
Set the column information from a column of a result set. |
ColumnInfo(java.lang.String name,
int type,
java.lang.Integer precision,
java.lang.Integer scale,
boolean nullable,
java.lang.String defaultValue)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ColumnInfo
public ColumnInfo(java.lang.String name,
int type,
java.lang.Integer precision,
java.lang.Integer scale,
boolean nullable,
java.lang.String defaultValue)
- Parameters:
name - The column name.type - The Type of the column.precision - The field with or precision of the column.scale - The number of fractional digits.nullable - Whether this column allows null values.defaultValue - The default column value.
ColumnInfo
public ColumnInfo(org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
- Parameters:
atts - A bag of XML attributes.
- Throws:
org.xml.sax.SAXException - If the attributes do not contain a name attribute.
ColumnInfo
public ColumnInfo(java.sql.ResultSetMetaData md,
int column)
throws java.sql.SQLException
- Set the column information from a column of a result set.
- Parameters:
md - Result set metadata information received trough ResultSet.getMetaData().column - The column number of the result set to inspect.
- Throws:
java.sql.SQLException - Upon Database errors.
toAttributes
public org.xml.sax.Attributes toAttributes()
- Returns:
- A SAX Attributes bag filled with the information about this column.
getDefaultValue
public java.lang.String getDefaultValue()
- Returns:
- the defaultValue
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
- Parameters:
defaultValue - the defaultValue to set
setName
public void setName(java.lang.String name)
- Parameters:
name - the name to set
setType
public void setType(int type)
- Parameters:
type - the type to set
setPrecision
public void setPrecision(java.lang.Integer precision)
- Parameters:
precision - the precision to set
setScale
public void setScale(java.lang.Integer scale)
- Parameters:
scale - the scale to set
setNullable
public void setNullable(boolean nullable)
- Parameters:
nullable - the nullable to set
getName
public java.lang.String getName()
- Returns:
- the name
getType
public int getType()
- Returns:
- The SQL type.
- See Also:
Types
getPrecision
public java.lang.Integer getPrecision()
- Returns:
- The optional field precision.
getScale
public java.lang.Integer getScale()
- Returns:
- The optional field scale (the precision after the comma).
isNullable
public boolean isNullable()
- Returns:
- Whether the column is nullable.
Copyright © 2007. All Rights Reserved.