public class CastHelper extends Object
| Constructor and Description |
|---|
CastHelper() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
castObjectToSQLType(Object ob,
int sql_type,
int sql_size,
int sql_scale,
String sql_type_string)
Casts a Java object to the SQL type specified by the given
DataTableColumnDef object.
|
static Date |
toDate(String str)
Parses a String as an SQL date.
|
static Date |
toTime(String str)
Parses a String as an SQL time.
|
static Date |
toTimeStamp(String str)
Parses a String as an SQL timestamp.
|
public static Object castObjectToSQLType(Object ob, int sql_type, int sql_size, int sql_scale, 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"Copyright © 2015. All rights reserved.