Used by PreparedStatementCreatorFactory and CallableStatementCreatorFactory, but also available for direct use in custom setter/creator implementations.
PreparedStatementSetter, PreparedStatementCreator, CallableStatementCreator, PreparedStatementCreatorFactory, CallableStatementCreatorFactory, SqlParameter, SqlTypeValue, org.springframework.jdbc.core.support.SqlLobValue
| Modifier and Type | Field and Description |
|---|---|
| public static final String | IGNORE_GETPARAMETERTYPE_PROPERTY_NAME
System property that instructs Spring to ignore |
| private static final Map | |
| private static final Log | |
| pack-priv static Boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | cleanupParameters(Object...
parameter values supplied. May be paramValues)null.Clean up all resources held by parameter values which were passed to an execute method. |
| public static void | cleanupParameters(Collection<?>
parameter values supplied. May be paramValues)null.Clean up all resources held by parameter values which were passed to an execute method. |
| private static boolean | isDateValue(Class<?> inValueType)
Check whether the given value is a |
| private static boolean | |
| public static int | Returns: the corresponding SQL type, orSqlTypeValue#TYPE_UNKNOWN if none foundthe Java type to translate javaType)Derive a default SQL type from the given Java type. |
| private static void | setNull(PreparedStatement ps, int paramIndex, int sqlType, String typeName)
Set the specified PreparedStatement parameter to null, respecting database-specific peculiarities. |
| public static void | setParameterValue(PreparedStatement
the prepared statement or callable statement ps, int index of the parameter we are setting paramIndex, SqlParameter the parameter as it is declared including type param, Object the value to set inValue)Set the value for a parameter. |
| public static void | setParameterValue(PreparedStatement
the prepared statement or callable statement ps, int index of the parameter we are setting paramIndex, int the SQL type of the parameter sqlType, Object the value to set (plain value or an SqlTypeValue) inValue)Set the value for a parameter. |
| public static void | setParameterValue(PreparedStatement
the prepared statement or callable statement ps, int index of the parameter we are setting paramIndex, int the SQL type of the parameter sqlType, String the type name of the parameter
(optional, only used for SQL NULL and SqlTypeValue) typeName, Object the value to set (plain value or an SqlTypeValue) inValue)Set the value for a parameter. |
| private static void | setParameterValueInternal(PreparedStatement
the prepared statement or callable statement ps, int index of the parameter we are setting paramIndex, int the SQL type of the parameter sqlType, String the type name of the parameter
(optional, only used for SQL NULL and SqlTypeValue) typeName, Integer the number of digits after the decimal point
(for DECIMAL and NUMERIC types) scale, Object the value to set (plain value or an SqlTypeValue) inValue)Set the value for a parameter. |
| private static void | setValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName, Integer scale, Object inValue)
|
| IGNORE_GETPARAMETERTYPE_PROPERTY_NAME | back to summary |
|---|---|
| public static final String IGNORE_GETPARAMETERTYPE_PROPERTY_NAME System property that instructs Spring to ignore The default is "false", trying Consider switching this flag to "true" if you experience misbehavior at runtime,
e.g. with connection pool issues in case of an exception thrown from | |
| javaTypeToSqlTypeMap | back to summary |
|---|---|
| private static final Map<Class<?>, Integer> javaTypeToSqlTypeMap | |
| logger | back to summary |
|---|---|
| private static final Log logger | |
| shouldIgnoreGetParameterType | back to summary |
|---|---|
| pack-priv static Boolean shouldIgnoreGetParameterType
| |
| StatementCreatorUtils | back to summary |
|---|---|
| public StatementCreatorUtils() | |
| cleanupParameters | back to summary |
|---|---|
| public static void cleanupParameters(Object... paramValues) Clean up all resources held by parameter values which were passed to an execute method. This is for example important for closing LOB values.
| |
| cleanupParameters | back to summary |
|---|---|
| public static void cleanupParameters(Collection<?> paramValues) Clean up all resources held by parameter values which were passed to an execute method. This is for example important for closing LOB values.
| |
| isDateValue | back to summary |
|---|---|
| private static boolean isDateValue(Class<?> inValueType) Check whether the given value is a | |
| isStringValue | back to summary |
|---|---|
| private static boolean isStringValue(Class<?> inValueType) Check whether the given value can be treated as a String value. | |
| javaTypeToSqlParameterType | back to summary |
|---|---|
| public static int javaTypeToSqlParameterType(Class<?> javaType) Derive a default SQL type from the given Java type.
| |
| setNull | back to summary |
|---|---|
| private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, String typeName) throws SQLException Set the specified PreparedStatement parameter to null, respecting database-specific peculiarities. | |
| setParameterValue | back to summary |
|---|---|
| public static void setParameterValue(PreparedStatement ps, int paramIndex, SqlParameter param, Object inValue) throws SQLException Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
| |
| setParameterValue | back to summary |
|---|---|
| public static void setParameterValue(PreparedStatement ps, int paramIndex, int sqlType, Object inValue) throws SQLException Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
| |
| setParameterValue | back to summary |
|---|---|
| public static void setParameterValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName, Object inValue) throws SQLException Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
| |
| setParameterValueInternal | back to summary |
|---|---|
| private static void setParameterValueInternal(PreparedStatement ps, int paramIndex, int sqlType, String typeName, Integer scale, Object inValue) throws SQLException Set the value for a parameter. The method used is based on the SQL type of the parameter and we can handle complex types like arrays and LOBs.
| |
| setValue | back to summary |
|---|---|
| private static void setValue(PreparedStatement ps, int paramIndex, int sqlType, String typeName, Integer scale, Object inValue) throws SQLException | |