|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.database.global.CastHelper
public class CastHelper
Various utility methods for helping to cast a Java object to a type that is conformant to an SQL type.
Constructor Summary | |
---|---|
CastHelper()
|
Method Summary | |
---|---|
static java.lang.Object |
castObjectToSQLType(java.lang.Object ob,
int sql_type,
int sql_size,
int sql_scale,
java.lang.String sql_type_string)
Casts a Java object to the SQL type specified by the given DataTableColumnDef object. |
static java.util.Date |
toDate(java.lang.String str)
Parses a String as an SQL date. |
static java.util.Date |
toTime(java.lang.String str)
Parses a String as an SQL time. |
static java.util.Date |
toTimeStamp(java.lang.String str)
Parses a String as an SQL timestamp. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CastHelper()
Method Detail |
---|
public static java.util.Date toDate(java.lang.String str)
public static java.util.Date toTime(java.lang.String str)
public static java.util.Date toTimeStamp(java.lang.String str)
public static java.lang.Object castObjectToSQLType(java.lang.Object ob, int sql_type, int sql_size, int sql_scale, java.lang.String sql_type_string)
ob
- the Object to cast to the given typesql_type
- the enumerated sql type, eg. SQLTypes.LONGVARCHARsql_size
- the size of the type. For example, CHAR(20)sql_scale
- the scale of the numerical type.sql_type_string
- 'sql_type' as a human understandable string,
eg. "LONGVARCHAR"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |