org.springframework.data.jdbc.support

## Class JdbcUtil

- java.lang.Object
- - org.springframework.data.jdbc.support.JdbcUtil

    public final class JdbcUtil
    extends Object

Contains methods dealing with the quirks of JDBC, independent of any Entity, Aggregate or Repository abstraction.

Author:
  Jens Schauder, Thomas Lang

### Method Summary

All Methods Static Methods Concrete Methods
`static JDBCType` `jdbcTypeFor(Class<?> type)` Returns the `JDBCType` suitable for passing a value of the provided type to a `PreparedStatement`.
`static JDBCType` `jdbcTypeFor(int sqlType)` Converts a value defined in `Types` into a `JDBCType` instance or null if the value is `JdbcUtils.TYPE_UNKNOWN`
`static int` `sqlTypeFor(Class<?> type)` Returns the `Types` value suitable for passing a value of the provided type to a `PreparedStatement`.
`static int` `sqlTypeFor(JDBCType jdbcType)` Converts a `JDBCType` to an `int` value as defined in `Types`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### sqlTypeFor

    public static int sqlTypeFor(Class<?> type)

Returns the `Types` value suitable for passing a value of the provided type to a `PreparedStatement`.

Parameters:
  `type` - The type of value to be bound to a `PreparedStatement`.
Returns:
  One of the values defined in `Types` or `JdbcUtils.TYPE_UNKNOWN`.

#### sqlTypeFor

    public static int sqlTypeFor(@Nullable
                                 JDBCType jdbcType)

Converts a `JDBCType` to an `int` value as defined in `Types`.

Parameters:
  `jdbcType` - value to be converted. May be null.
Returns:
  One of the values defined in `Types` or `JdbcUtils.TYPE_UNKNOWN`.

#### jdbcTypeFor

    @Nullable
    public static JDBCType jdbcTypeFor(int sqlType)

Converts a value defined in `Types` into a `JDBCType` instance or null if the value is `JdbcUtils.TYPE_UNKNOWN`

Parameters:
  `sqlType` - One of the values defined in `Types` or `JdbcUtils.TYPE_UNKNOWN`.
Returns:
  a matching `JDBCType` instance or null.

#### jdbcTypeFor

    @Nullable
    public static JDBCType jdbcTypeFor(Class<?> type)

Returns the `JDBCType` suitable for passing a value of the provided type to a `PreparedStatement`.

Parameters:
  `type` - The type of value to be bound to a `PreparedStatement`.
Returns:
  a matching `JDBCType` instance or null.