|
|||||||||
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 java.lang.Object |
getValue(java.sql.ResultSet rs,
int index,
int sqlType)
Get value from given ResultSet at given index with given SQL type. |
static int |
javaType2sqlTypeNum(java.lang.Class javaType)
Returns the SQL type from the specified Java type. |
static void |
setValue(java.sql.PreparedStatement stmt,
int index,
java.lang.Object value,
int sqlType)
Set given value on given PreparedStatement at given index with given SQL type. |
static java.lang.Class |
sqlTypeName2javaType(java.lang.String sqlTypeName)
Returns the Java type for the given SQL type name. |
static java.lang.Class |
sqlTypeNum2javaType(int sqlTypeNum)
Returns the Java type for the given SQL type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Class sqlTypeNum2javaType(int sqlTypeNum) throws MappingException
sqlTypeNum
- SQL type name (see JDBC API)
MappingException
- The SQL type is not recognized.public static java.lang.Class sqlTypeName2javaType(java.lang.String sqlTypeName) throws MappingException
sqlTypeName
- SQL type name (e.g. numeric).
MappingException
- The SQL type is not recognized.public static int javaType2sqlTypeNum(java.lang.Class javaType)
javaType
- The Java class of the SQL type.
public static java.lang.Object getValue(java.sql.ResultSet rs, int index, int sqlType) throws java.sql.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.
java.sql.SQLException
- If a database access error occurs.public static void setValue(java.sql.PreparedStatement stmt, int index, java.lang.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 |