|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.sql.meta.TypesInfo
public class TypesInfo
Types to Java Static class to translate java.sql.Types into appropriate Java types At the moment only primitives, String and java.sql.Date,Time,Timestamp are used
Field Summary | |
---|---|
static TypesInfo |
DEFAULT
|
static int |
LARGE
|
static int |
OPTIMIZE
|
static int |
SMALLEST
|
Constructor Summary | |
---|---|
TypesInfo(java.sql.Connection con)
|
Method Summary | |
---|---|
int |
getDataType(java.lang.Class c)
get the java.sql.Types value for a given class |
java.lang.Class |
getJavaType(int dataType,
int columnsize,
int decimaldigits)
gets a Class as a valid java type on the basis of JDBC column information |
java.lang.String |
getJavaTypeName(int dataType,
int columnsize,
int decimaldigits)
gets a String representation of a valid java type on the basis of JDBC column information |
java.lang.String |
getLimitRows(int count)
|
java.lang.String |
getSQLType(int dataType)
|
java.util.Collection |
getTypeNames()
|
java.util.HashMap |
getTypes()
|
boolean |
isPrimitive(int dataType)
get the JavaType for a specific dataType as defined in java.sql.Types |
void |
setDataModel(int dataModel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final TypesInfo DEFAULT
public static final int SMALLEST
public static final int OPTIMIZE
public static final int LARGE
Constructor Detail |
---|
public TypesInfo(java.sql.Connection con)
Method Detail |
---|
public int getDataType(java.lang.Class c)
java.sql.Types
value for a given class
c
- Class, the class for which the java.sql.Types value is requested
java.sql.Types
public java.lang.String getJavaTypeName(int dataType, int columnsize, int decimaldigits)
Normally the dataType is enough to make a good determination, except in the case of Numbers.
Types.OTHER is returned as a generic Object.
Note:Please be sure to understand that not all Types are defined and translated here if you miss one add it yourself or mail me.
dataType
- int, A valid datatype from java.sql.Typescolumnsize
- int, The length of the columndecimaldigits
- int, The number of decimal digits
public boolean isPrimitive(int dataType)
This method returns only one of two values PRIMITIVE or CLASS
dataType
- int, the datatype as defined in java.sql.Types
Note:Please be sure to understand that the determination is not done for all Types if you miss one add it yourself or mail me.
public java.lang.Class getJavaType(int dataType, int columnsize, int decimaldigits)
Normally the dataType is enough to make a good determination, except in the case of Numbers.
Types.OTHER is returned as a generic Object.
Note:Please be sure to understand that not all Types are defined and translated here if you miss one add it yourself or mail me.
dataType
- int, A valid datatype from java.sql.Typescolumnsize
- int, The length of the columndecimaldigits
- int, The number of decimal digits
public java.lang.String getLimitRows(int count)
public java.lang.String getSQLType(int dataType)
public java.util.Collection getTypeNames()
public java.util.HashMap getTypes()
public void setDataModel(int dataModel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |