@@ -120,8 +120,7 @@ public static int javaTypeToSqlParameterType(Class javaType) {
120
120
* @param inValue the value to set
121
121
* @throws SQLException if thrown by PreparedStatement methods
122
122
*/
123
- public static void setParameterValue (
124
- PreparedStatement ps , int paramIndex , SqlParameter param , Object inValue )
123
+ public static void setParameterValue (PreparedStatement ps , int paramIndex , SqlParameter param , Object inValue )
125
124
throws SQLException {
126
125
127
126
setParameterValueInternal (ps , paramIndex , param .getSqlType (), param .getTypeName (), param .getScale (), inValue );
@@ -137,8 +136,7 @@ public static void setParameterValue(
137
136
* @throws SQLException if thrown by PreparedStatement methods
138
137
* @see SqlTypeValue
139
138
*/
140
- public static void setParameterValue (
141
- PreparedStatement ps , int paramIndex , int sqlType , Object inValue )
139
+ public static void setParameterValue (PreparedStatement ps , int paramIndex , int sqlType , Object inValue )
142
140
throws SQLException {
143
141
144
142
setParameterValueInternal (ps , paramIndex , sqlType , null , null , inValue );
@@ -156,9 +154,8 @@ public static void setParameterValue(
156
154
* @throws SQLException if thrown by PreparedStatement methods
157
155
* @see SqlTypeValue
158
156
*/
159
- public static void setParameterValue (
160
- PreparedStatement ps , int paramIndex , int sqlType , String typeName , Object inValue )
161
- throws SQLException {
157
+ public static void setParameterValue (PreparedStatement ps , int paramIndex , int sqlType , String typeName ,
158
+ Object inValue ) throws SQLException {
162
159
163
160
setParameterValueInternal (ps , paramIndex , sqlType , typeName , null , inValue );
164
161
}
@@ -177,9 +174,8 @@ public static void setParameterValue(
177
174
* @throws SQLException if thrown by PreparedStatement methods
178
175
* @see SqlTypeValue
179
176
*/
180
- private static void setParameterValueInternal (
181
- PreparedStatement ps , int paramIndex , int sqlType , String typeName , Integer scale , Object inValue )
182
- throws SQLException {
177
+ private static void setParameterValueInternal (PreparedStatement ps , int paramIndex , int sqlType ,
178
+ String typeName , Integer scale , Object inValue ) throws SQLException {
183
179
184
180
String typeNameToUse = typeName ;
185
181
int sqlTypeToUse = sqlType ;
@@ -190,8 +186,7 @@ private static void setParameterValueInternal(
190
186
SqlParameterValue parameterValue = (SqlParameterValue ) inValue ;
191
187
if (logger .isDebugEnabled ()) {
192
188
logger .debug ("Overriding type info with runtime info from SqlParameterValue: column index " + paramIndex +
193
- ", SQL type " + parameterValue .getSqlType () +
194
- ", Type name " + parameterValue .getTypeName ());
189
+ ", SQL type " + parameterValue .getSqlType () + ", type name " + parameterValue .getTypeName ());
195
190
}
196
191
if (parameterValue .getSqlType () != SqlTypeValue .TYPE_UNKNOWN ) {
197
192
sqlTypeToUse = parameterValue .getSqlType ();
@@ -221,9 +216,7 @@ private static void setParameterValueInternal(
221
216
* Set the specified PreparedStatement parameter to null,
222
217
* respecting database-specific peculiarities.
223
218
*/
224
- private static void setNull (PreparedStatement ps , int paramIndex , int sqlType , String typeName )
225
- throws SQLException {
226
-
219
+ private static void setNull (PreparedStatement ps , int paramIndex , int sqlType , String typeName ) throws SQLException {
227
220
if (sqlType == SqlTypeValue .TYPE_UNKNOWN ) {
228
221
boolean useSetObject = false ;
229
222
sqlType = Types .NULL ;
@@ -232,10 +225,9 @@ private static void setNull(PreparedStatement ps, int paramIndex, int sqlType, S
232
225
}
233
226
catch (Throwable ex ) {
234
227
if (logger .isDebugEnabled ()) {
235
- logger .debug ("JDBC 3.0 getParameterType call not supported: " + ex );
228
+ logger .debug ("JDBC 3.0 getParameterType call not supported - using fallback method instead : " + ex );
236
229
}
237
- // JDBC driver not compliant with JDBC 3.0
238
- // -> proceed with database-specific checks
230
+ // JDBC driver not compliant with JDBC 3.0 -> proceed with database-specific checks
239
231
try {
240
232
DatabaseMetaData dbmd = ps .getConnection ().getMetaData ();
241
233
String databaseProductName = dbmd .getDatabaseProductName ();
0 commit comments