@@ -3094,10 +3094,10 @@ public void testExecuteDelAndSelect() {
3094
3094
/**
3095
3095
* Tests multi-statement PreparedStatement with loop to process all results
3096
3096
*
3097
- * @throws Exception
3097
+ * @throws SQLException
3098
3098
*/
3099
3099
@ Test
3100
- public void testMultiStatementPreparedStatementLoopResults () {
3100
+ public void testMultiStatementPreparedStatementLoopResults () throws SQLException {
3101
3101
try (Connection con = getConnection ()) {
3102
3102
try (PreparedStatement ps = con .prepareStatement ("DELETE FROM " + tableName + " " +
3103
3103
"INSERT INTO " + tableName + " (NAME) VALUES (?) " +
@@ -3137,18 +3137,16 @@ public void testMultiStatementPreparedStatementLoopResults() {
3137
3137
retval = ps .getMoreResults ();
3138
3138
} while (true );
3139
3139
}
3140
- } catch (SQLException e ) {
3141
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3142
3140
}
3143
3141
}
3144
3142
3145
3143
/**
3146
3144
* Tests PreparedStatement execute for Insert followed by select
3147
3145
*
3148
- * @throws Exception
3146
+ * @throws SQLException
3149
3147
*/
3150
3148
@ Test
3151
- public void testPreparedStatementExecuteInsertAndSelect () {
3149
+ public void testPreparedStatementExecuteInsertAndSelect () throws SQLException {
3152
3150
try (Connection con = getConnection ()) {
3153
3151
String sql = "INSERT INTO " + tableName + " (NAME) VALUES(?) " +
3154
3152
"SELECT NAME FROM " + tableName + " WHERE ID = 1" ;
@@ -3176,18 +3174,16 @@ public void testPreparedStatementExecuteInsertAndSelect() {
3176
3174
retval = ps .getMoreResults ();
3177
3175
} while (true );
3178
3176
}
3179
- } catch (SQLException e ) {
3180
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3181
3177
}
3182
3178
}
3183
3179
3184
3180
/**
3185
3181
* Tests PreparedStatement execute for Merge followed by select
3186
3182
*
3187
- * @throws Exception
3183
+ * @throws SQLException
3188
3184
*/
3189
3185
@ Test
3190
- public void testPreparedStatementExecuteMergeAndSelect () {
3186
+ public void testPreparedStatementExecuteMergeAndSelect () throws SQLException {
3191
3187
try (Connection con = getConnection ()) {
3192
3188
String sql = "MERGE INTO " + tableName + " AS target " +
3193
3189
"USING (VALUES (?)) AS source (name) " +
@@ -3219,18 +3215,16 @@ public void testPreparedStatementExecuteMergeAndSelect() {
3219
3215
retval = ps .getMoreResults ();
3220
3216
} while (true );
3221
3217
}
3222
- } catch (SQLException e ) {
3223
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3224
3218
}
3225
3219
}
3226
3220
3227
3221
/**
3228
3222
* Tests PreparedStatement execute two Inserts followed by select
3229
3223
*
3230
- * @throws Exception
3224
+ * @throws SQLException
3231
3225
*/
3232
3226
@ Test
3233
- public void testPreparedStatementExecuteTwoInsertsRowsAndSelect () {
3227
+ public void testPreparedStatementExecuteTwoInsertsRowsAndSelect () throws SQLException {
3234
3228
try (Connection con = getConnection ()) {
3235
3229
try (PreparedStatement ps = con .prepareStatement ("INSERT INTO " + tableName + " (NAME) VALUES(?) INSERT INTO " + tableName + " (NAME) VALUES(?) SELECT NAME from " + tableName + " WHERE ID = 1" )) {
3236
3230
ps .setString (1 , "test" );
@@ -3257,18 +3251,16 @@ public void testPreparedStatementExecuteTwoInsertsRowsAndSelect() {
3257
3251
retval = ps .getMoreResults ();
3258
3252
} while (true );
3259
3253
}
3260
- } catch (SQLException e ) {
3261
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3262
3254
}
3263
3255
}
3264
3256
3265
3257
/**
3266
3258
* Tests PreparedStatement execute for Update followed by select
3267
3259
*
3268
- * @throws Exception
3260
+ * @throws SQLException
3269
3261
*/
3270
3262
@ Test
3271
- public void testPreparedStatementExecuteUpdAndSelect () {
3263
+ public void testPreparedStatementExecuteUpdAndSelect () throws SQLException {
3272
3264
try (Connection con = getConnection ()) {
3273
3265
try (PreparedStatement ps = con .prepareStatement ("UPDATE " + tableName + " SET NAME = ? SELECT NAME FROM " + tableName + " WHERE ID = 1" )) {
3274
3266
ps .setString (1 , "test" );
@@ -3294,18 +3286,16 @@ public void testPreparedStatementExecuteUpdAndSelect() {
3294
3286
retval = ps .getMoreResults ();
3295
3287
} while (true );
3296
3288
}
3297
- } catch (SQLException e ) {
3298
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3299
3289
}
3300
3290
}
3301
3291
3302
3292
/**
3303
3293
* Tests PreparedStatement execute for Delete followed by select
3304
3294
*
3305
- * @throws Exception
3295
+ * @throws SQLException
3306
3296
*/
3307
3297
@ Test
3308
- public void testPreparedStatementExecuteDelAndSelect () {
3298
+ public void testPreparedStatementExecuteDelAndSelect () throws SQLException {
3309
3299
try (Connection con = getConnection ()) {
3310
3300
try (PreparedStatement ps = con .prepareStatement ("DELETE FROM " + tableName + " WHERE ID = ? SELECT NAME FROM " + tableName + " WHERE ID = 2" )) {
3311
3301
ps .setInt (1 , 1 );
@@ -3331,8 +3321,6 @@ public void testPreparedStatementExecuteDelAndSelect() {
3331
3321
retval = ps .getMoreResults ();
3332
3322
} while (true );
3333
3323
}
3334
- } catch (SQLException e ) {
3335
- fail (TestResource .getResource ("R_unexpectedException" ) + e .getMessage ());
3336
3324
}
3337
3325
}
3338
3326
0 commit comments