|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.jdo.engine.SQLTypeInfos
public final class SQLTypeInfos
Utility class to translate SQL type by integer value or name into corresponding Java type.
| Method Summary | |
|---|---|
static Object |
getValue(ResultSet rs,
int index,
int sqlType)
Get value from given ResultSet at given index with given SQL type. |
static int |
javaType2sqlTypeNum(Class<?> javaType)
Returns the SQL type from the specified Java type. |
static void |
setValue(PreparedStatement stmt,
int index,
Object value,
int sqlType)
Set given value on given PreparedStatement at given index with given SQL type. |
static Class<?> |
sqlTypeName2javaType(String sqlTypeName)
Returns the Java type for the given SQL type name. |
static Class<?> |
sqlTypeNum2javaType(int sqlTypeNum)
Returns the Java type for the given SQL type. |
static String |
sqlTypeNum2sqlTypeName(int sqlTypeNum)
Returns the SQL type name for the given SQL type number. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Class<?> sqlTypeNum2javaType(int sqlTypeNum)
throws MappingException
sqlTypeNum - SQL type name (see JDBC API)
MappingException - The SQL type is not recognized.
public static String sqlTypeNum2sqlTypeName(int sqlTypeNum)
throws MappingException
sqlTypeNum - SQL type name (see JDBC API)
MappingException - The SQL type is not recognized.
public static Class<?> sqlTypeName2javaType(String sqlTypeName)
throws MappingException
sqlTypeName - SQL type name (e.g. numeric).
MappingException - The SQL type is not recognized.public static int javaType2sqlTypeNum(Class<?> javaType)
javaType - The Java class of the SQL type.
public static Object getValue(ResultSet rs,
int index,
int sqlType)
throws SQLException
rs - The ResultSet to get the value from.index - The index of the value in the ResultSet.sqlType - The SQL type of the value.
SQLException - If a database access error occurs.
public static void setValue(PreparedStatement stmt,
int index,
Object value,
int sqlType)
stmt - The PreparedStatement to set value on.index - The index of the value in the PreparedStatement.value - The value to set.sqlType - The SQL type of the value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||