|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.SQL.Variable
Provides an object-oriented view of a table column from an SDD Schema. Created and used by the SDD Parser to store information parsed from the SDD Schema frame. Represents the column name, data type, and associated constraints such as NOT NULL or DEFAULT.
| Field Summary | |
static int |
BIT
|
static int |
CHAR
|
static int |
DEC
|
static int |
DEFAULT
|
static int |
DOUBLE
|
static int |
FLOAT
|
static int |
INTEGER
|
static int |
NOT_NULL
|
static int |
NUMERIC
|
static int |
PRIMARY_KEY
|
static int |
RAW
|
static int |
REAL
|
static int |
SMALLINT
|
static int |
UNIQUE
|
| Constructor Summary | |
Variable(int type)
Constructs a Variable with the given type. |
|
Variable(int type,
int size)
Constructs a Variable with the given type and size. |
|
Variable(int type,
int size,
int decimal_digits)
Constructs a Variable given its type, precision or size, and scale. |
|
Variable(java.lang.String name,
int type)
Constructs a Variable given its name and type |
|
Variable(java.lang.String name,
int type,
int constraints)
Constructs a Variable given its name, type, and constraints. |
|
Variable(java.lang.String name,
int type,
int size,
int constraints)
Constructs a Variable given its name, type, size, and constraints. |
|
Variable(java.lang.String name,
int type,
int size,
int decimal_digits,
int constraints)
Constructs a Variable given its name, type, precision, scale, and constraints. |
|
| Method Summary | |
void |
addConstraint(int constraint)
Specifies an SQL constraint to apply to this variable. |
java.lang.Object |
clone()
|
boolean |
equals(Variable v)
Equality comparison for data types. |
java.lang.String |
getName()
|
int |
getPrecision()
|
static java.lang.Object |
getResultSetData(Variable var,
java.sql.ResultSet rs)
static method to extract appropriate types from result set. |
int |
getScale()
|
int |
getSize()
returns the number of elements in a string or array data type such as fixed-length character and bit strings. |
int |
getType()
|
java.lang.String |
getTypeName()
|
boolean |
isDefault()
|
boolean |
isNotNull()
|
boolean |
isPrimaryKey()
|
boolean |
isUnique()
|
static int |
JDBC2Variable(int jdbcType)
maps java.sql.Types types to its.SQL.Variable types |
void |
removeConstraint(int constraint)
Specifies an SQL constraint to remove from this variable. |
void |
setName(java.lang.String s)
|
java.lang.String |
toSql()
Generates the SQL column definition string for this variable |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int CHAR
public static final int BIT
public static final int INTEGER
public static final int SMALLINT
public static final int NUMERIC
public static final int DEC
public static final int FLOAT
public static final int REAL
public static final int DOUBLE
public static final int RAW
public static final int NOT_NULL
public static final int DEFAULT
public static final int PRIMARY_KEY
public static final int UNIQUE
| Constructor Detail |
public Variable(java.lang.String name,
int type)
name - the name of the column this object describestype - one of the type constants defined in this class
public Variable(java.lang.String name,
int type,
int constraints)
name - the name of the column this object describestype - one of the type constants defined in this classconstraints - bitwise combination of constraint constants defined in this class
public Variable(java.lang.String name,
int type,
int size,
int constraints)
name - the name of the column this object describestype - one of the type constants defined in this classsize - array length for CHAR and BIT fieldsconstraints - bitwise combination of constraint constants defined in this class
public Variable(java.lang.String name,
int type,
int size,
int decimal_digits,
int constraints)
name - the name of the column this object describestype - one of the type constants defined in this classsize - for CHAR and BIT types, this is the max number of characters;
NUMERIC and DECIMAL types, this is the precision.decimal_digits - for NUMERIC and DECIMAL types only, the number of fractional digitsconstraints - bitwise combination of constraint constants defined in this class
public Variable(int type,
int size,
int decimal_digits)
type - one of the type constants defined in this classsize - for CHAR and BIT types, this is the max number of characters;
NUMERIC and DECIMAL types, this is the precision.decimal_digits - for NUMERIC and DECIMAL types only, the number of fractional digits
public Variable(int type,
int size)
type - one of the type constants defined in this classsize - array length for CHAR and BIT fieldspublic Variable(int type)
type - one of the type constants defined in this class| Method Detail |
public java.lang.String getTypeName()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic static int JDBC2Variable(int jdbcType)
jdbcType - int value of JDBC typepublic void addConstraint(int constraint)
public void removeConstraint(int constraint)
public java.lang.String getName()
public void setName(java.lang.String s)
s - the name of the variablepublic int getType()
public int getSize()
public int getPrecision()
public int getScale()
public boolean isNotNull()
public boolean isDefault()
public boolean isUnique()
public boolean isPrimaryKey()
public static java.lang.Object getResultSetData(Variable var,
java.sql.ResultSet rs)
throws java.sql.SQLException
var - the Variablers - the ResultSet
java.sql.SQLExceptionpublic boolean equals(Variable v)
public java.lang.String toSql()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||