Class JdbcUtil
java.lang.Object
org.springframework.data.jdbc.support.JdbcUtil
Contains methods dealing with the quirks of JDBC, independent of any Entity, Aggregate or Repository abstraction.
- Author:
- Jens Schauder, Thomas Lang
-
Method Summary
Modifier and TypeMethodDescriptionstatic JDBCTypejdbcTypeFor(int sqlType) Converts a value defined inTypesinto aJDBCTypeinstance or null if the value isJdbcUtils.TYPE_UNKNOWNstatic JDBCTypejdbcTypeFor(Class<?> type) Returns theJDBCTypesuitable for passing a value of the provided type to aPreparedStatement.static intsqlTypeFor(Class<?> type) Returns theTypesvalue suitable for passing a value of the provided type to aPreparedStatement.static intsqlTypeFor(JDBCType jdbcType)
-
Method Details
-
sqlTypeFor
Returns theTypesvalue suitable for passing a value of the provided type to aPreparedStatement.- Parameters:
type- The type of value to be bound to aPreparedStatement.- Returns:
- One of the values defined in
TypesorJdbcUtils.TYPE_UNKNOWN.
-
sqlTypeFor
- Parameters:
jdbcType- value to be converted. May be null.- Returns:
- One of the values defined in
TypesorJdbcUtils.TYPE_UNKNOWN.
-
jdbcTypeFor
Converts a value defined inTypesinto aJDBCTypeinstance or null if the value isJdbcUtils.TYPE_UNKNOWN- Parameters:
sqlType- One of the values defined inTypesorJdbcUtils.TYPE_UNKNOWN.- Returns:
- a matching
JDBCTypeinstance or null.
-
jdbcTypeFor
Returns theJDBCTypesuitable for passing a value of the provided type to aPreparedStatement.- Parameters:
type- The type of value to be bound to aPreparedStatement.- Returns:
- a matching
JDBCTypeinstance or null.
-