@@ -205,13 +205,14 @@ private String createUrl() {
205
205
getPort (), "proj" , "inst" , "db" );
206
206
}
207
207
208
- private Connection createConnection () throws SQLException {
208
+ @ Override
209
+ protected Connection createJdbcConnection () throws SQLException {
209
210
return DriverManager .getConnection (createUrl ());
210
211
}
211
212
212
213
@ Test
213
214
public void testStatementExecuteQuery () throws SQLException {
214
- try (Connection connection = createConnection ();
215
+ try (Connection connection = createJdbcConnection ();
215
216
Statement statement = connection .createStatement ()) {
216
217
try (ResultSet resultSet = statement .executeQuery (query )) {
217
218
verifyResultSet (resultSet );
@@ -231,7 +232,7 @@ public void testStatementExecuteQuery() throws SQLException {
231
232
232
233
@ Test
233
234
public void testStatementExecuteUpdate () throws SQLException {
234
- try (Connection connection = createConnection ();
235
+ try (Connection connection = createJdbcConnection ();
235
236
Statement statement = connection .createStatement ()) {
236
237
assertEquals (1 , statement .executeUpdate (dml ));
237
238
assertEquals (0 , statement .executeUpdate (DDL ));
@@ -249,7 +250,7 @@ public void testStatementExecuteUpdate() throws SQLException {
249
250
250
251
@ Test
251
252
public void testStatementExecuteUpdateReturnGeneratedKeys () throws SQLException {
252
- try (Connection connection = createConnection ();
253
+ try (Connection connection = createJdbcConnection ();
253
254
Statement statement = connection .createStatement ()) {
254
255
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
255
256
assertEquals (1 , statement .executeUpdate (dml , Statement .NO_GENERATED_KEYS ));
@@ -265,7 +266,7 @@ public void testStatementExecuteUpdateReturnGeneratedKeys() throws SQLException
265
266
266
267
@ Test
267
268
public void testStatementExecuteUpdateReturnColumnNames () throws SQLException {
268
- try (Connection connection = createConnection ();
269
+ try (Connection connection = createJdbcConnection ();
269
270
Statement statement = connection .createStatement ()) {
270
271
assertEquals (1 , statement .executeUpdate (dml , new String [] {"id" }));
271
272
assertEquals (0 , statement .executeUpdate (DDL , new String [] {"id" }));
@@ -283,7 +284,7 @@ public void testStatementExecuteUpdateReturnColumnNames() throws SQLException {
283
284
284
285
@ Test
285
286
public void testStatementExecuteUpdateReturnColumnIndexes () throws SQLException {
286
- try (Connection connection = createConnection ();
287
+ try (Connection connection = createJdbcConnection ();
287
288
Statement statement = connection .createStatement ()) {
288
289
assertEquals (1 , statement .executeUpdate (dml , new int [] {1 }));
289
290
assertEquals (0 , statement .executeUpdate (DDL , new int [] {1 }));
@@ -297,7 +298,7 @@ public void testStatementExecuteUpdateReturnColumnIndexes() throws SQLException
297
298
298
299
@ Test
299
300
public void testStatementLargeExecuteUpdate () throws SQLException {
300
- try (Connection connection = createConnection ();
301
+ try (Connection connection = createJdbcConnection ();
301
302
Statement statement = connection .createStatement ()) {
302
303
assertEquals (1L , statement .executeLargeUpdate (dml ));
303
304
assertEquals (0L , statement .executeLargeUpdate (DDL ));
@@ -311,7 +312,7 @@ public void testStatementLargeExecuteUpdate() throws SQLException {
311
312
312
313
@ Test
313
314
public void testStatementExecuteLargeUpdateReturnGeneratedKeys () throws SQLException {
314
- try (Connection connection = createConnection ();
315
+ try (Connection connection = createJdbcConnection ();
315
316
Statement statement = connection .createStatement ()) {
316
317
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
317
318
assertEquals (1 , statement .executeLargeUpdate (dml , Statement .NO_GENERATED_KEYS ));
@@ -329,7 +330,7 @@ public void testStatementExecuteLargeUpdateReturnGeneratedKeys() throws SQLExcep
329
330
330
331
@ Test
331
332
public void testStatementExecuteLargeUpdateReturnColumnNames () throws SQLException {
332
- try (Connection connection = createConnection ();
333
+ try (Connection connection = createJdbcConnection ();
333
334
Statement statement = connection .createStatement ()) {
334
335
assertEquals (1 , statement .executeLargeUpdate (dml , new String [] {"id" }));
335
336
assertEquals (0 , statement .executeLargeUpdate (DDL , new String [] {"id" }));
@@ -346,7 +347,7 @@ public void testStatementExecuteLargeUpdateReturnColumnNames() throws SQLExcepti
346
347
347
348
@ Test
348
349
public void testStatementExecuteLargeUpdateReturnColumnIndexes () throws SQLException {
349
- try (Connection connection = createConnection ();
350
+ try (Connection connection = createJdbcConnection ();
350
351
Statement statement = connection .createStatement ()) {
351
352
assertEquals (1 , statement .executeLargeUpdate (dml , new int [] {1 }));
352
353
assertEquals (0 , statement .executeLargeUpdate (DDL , new int [] {1 }));
@@ -360,7 +361,7 @@ public void testStatementExecuteLargeUpdateReturnColumnIndexes() throws SQLExcep
360
361
361
362
@ Test
362
363
public void testStatementExecute () throws SQLException {
363
- try (Connection connection = createConnection ();
364
+ try (Connection connection = createJdbcConnection ();
364
365
Statement statement = connection .createStatement ()) {
365
366
verifyUpdateCount (statement , () -> statement .execute (dml ), 1L );
366
367
verifyUpdateCount (statement , () -> statement .execute (largeDml ), LARGE_UPDATE_COUNT );
@@ -375,7 +376,7 @@ public void testStatementExecute() throws SQLException {
375
376
376
377
@ Test
377
378
public void testStatementExecuteReturnGeneratedKeys () throws SQLException {
378
- try (Connection connection = createConnection ();
379
+ try (Connection connection = createJdbcConnection ();
379
380
Statement statement = connection .createStatement ()) {
380
381
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
381
382
verifyUpdateCount (statement , () -> statement .execute (dml , Statement .NO_GENERATED_KEYS ), 1L );
@@ -401,7 +402,7 @@ public void testStatementExecuteReturnGeneratedKeys() throws SQLException {
401
402
402
403
@ Test
403
404
public void testStatementExecuteReturnColumnNames () throws SQLException {
404
- try (Connection connection = createConnection ();
405
+ try (Connection connection = createJdbcConnection ();
405
406
Statement statement = connection .createStatement ()) {
406
407
verifyUpdateCount (statement , () -> statement .execute (dml , new String [] {"id" }), 1L );
407
408
verifyUpdateCount (
@@ -420,7 +421,7 @@ public void testStatementExecuteReturnColumnNames() throws SQLException {
420
421
421
422
@ Test
422
423
public void testStatementExecuteReturnColumnIndexes () throws SQLException {
423
- try (Connection connection = createConnection ();
424
+ try (Connection connection = createJdbcConnection ();
424
425
Statement statement = connection .createStatement ()) {
425
426
verifyUpdateCount (statement , () -> statement .execute (dml , new int [] {1 }), 1L );
426
427
verifyUpdateCount (
@@ -439,7 +440,7 @@ public void testStatementExecuteReturnColumnIndexes() throws SQLException {
439
440
440
441
@ Test
441
442
public void testPreparedStatementExecuteQuery () throws SQLException {
442
- try (Connection connection = createConnection ()) {
443
+ try (Connection connection = createJdbcConnection ()) {
443
444
try (ResultSet resultSet = connection .prepareStatement (query ).executeQuery ()) {
444
445
verifyResultSet (resultSet );
445
446
}
@@ -458,7 +459,7 @@ public void testPreparedStatementExecuteQuery() throws SQLException {
458
459
459
460
@ Test
460
461
public void testPreparedStatementExecuteUpdate () throws SQLException {
461
- try (Connection connection = createConnection ()) {
462
+ try (Connection connection = createJdbcConnection ()) {
462
463
assertEquals (1 , connection .prepareStatement (dml ).executeUpdate ());
463
464
assertEquals (0 , connection .prepareStatement (DDL ).executeUpdate ());
464
465
assertEquals (0 , connection .prepareStatement (clientSideUpdate ).executeUpdate ());
@@ -472,7 +473,7 @@ public void testPreparedStatementExecuteUpdate() throws SQLException {
472
473
473
474
@ Test
474
475
public void testPreparedStatementExecuteUpdateReturnGeneratedKeys () throws SQLException {
475
- try (Connection connection = createConnection ()) {
476
+ try (Connection connection = createJdbcConnection ()) {
476
477
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
477
478
assertEquals (
478
479
1 , connection .prepareStatement (dml , Statement .NO_GENERATED_KEYS ).executeUpdate ());
@@ -503,7 +504,7 @@ public void testPreparedStatementExecuteUpdateReturnGeneratedKeys() throws SQLEx
503
504
504
505
@ Test
505
506
public void testPreparedStatementExecuteUpdateReturnColumnNames () throws SQLException {
506
- try (Connection connection = createConnection ()) {
507
+ try (Connection connection = createJdbcConnection ()) {
507
508
assertEquals (1 , connection .prepareStatement (dml , new String [] {"id" }).executeUpdate ());
508
509
assertEquals (0 , connection .prepareStatement (DDL , new String [] {"id" }).executeUpdate ());
509
510
assertEquals (
@@ -523,7 +524,7 @@ public void testPreparedStatementExecuteUpdateReturnColumnNames() throws SQLExce
523
524
524
525
@ Test
525
526
public void testPreparedStatementExecuteUpdateReturnColumnIndexes () throws SQLException {
526
- try (Connection connection = createConnection ()) {
527
+ try (Connection connection = createJdbcConnection ()) {
527
528
assertEquals (1 , connection .prepareStatement (dml , new int [] {1 }).executeUpdate ());
528
529
assertEquals (0 , connection .prepareStatement (DDL , new int [] {1 }).executeUpdate ());
529
530
assertEquals (0 , connection .prepareStatement (clientSideUpdate , new int [] {1 }).executeUpdate ());
@@ -539,7 +540,7 @@ public void testPreparedStatementExecuteUpdateReturnColumnIndexes() throws SQLEx
539
540
540
541
@ Test
541
542
public void testPreparedStatementLargeExecuteUpdate () throws SQLException {
542
- try (Connection connection = createConnection ()) {
543
+ try (Connection connection = createJdbcConnection ()) {
543
544
assertEquals (1L , connection .prepareStatement (dml ).executeLargeUpdate ());
544
545
assertEquals (0L , connection .prepareStatement (DDL ).executeLargeUpdate ());
545
546
assertEquals (0L , connection .prepareStatement (clientSideUpdate ).executeLargeUpdate ());
@@ -554,7 +555,7 @@ public void testPreparedStatementLargeExecuteUpdate() throws SQLException {
554
555
555
556
@ Test
556
557
public void testPreparedStatementExecuteLargeUpdateReturnGeneratedKeys () throws SQLException {
557
- try (Connection connection = createConnection ()) {
558
+ try (Connection connection = createJdbcConnection ()) {
558
559
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
559
560
assertEquals (
560
561
1 , connection .prepareStatement (dml , Statement .NO_GENERATED_KEYS ).executeLargeUpdate ());
@@ -587,7 +588,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnGeneratedKeys() throws
587
588
588
589
@ Test
589
590
public void testPreparedStatementExecuteLargeUpdateReturnColumnNames () throws SQLException {
590
- try (Connection connection = createConnection ()) {
591
+ try (Connection connection = createJdbcConnection ()) {
591
592
assertEquals (1 , connection .prepareStatement (dml , new String [] {"id" }).executeLargeUpdate ());
592
593
assertEquals (0 , connection .prepareStatement (DDL , new String [] {"id" }).executeLargeUpdate ());
593
594
assertEquals (
@@ -612,7 +613,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnColumnNames() throws SQ
612
613
613
614
@ Test
614
615
public void testPreparedStatementExecuteLargeUpdateReturnColumnIndexes () throws SQLException {
615
- try (Connection connection = createConnection ()) {
616
+ try (Connection connection = createJdbcConnection ()) {
616
617
assertEquals (1 , connection .prepareStatement (dml , new int [] {1 }).executeLargeUpdate ());
617
618
assertEquals (0 , connection .prepareStatement (DDL , new int [] {1 }).executeLargeUpdate ());
618
619
assertEquals (
@@ -631,7 +632,7 @@ public void testPreparedStatementExecuteLargeUpdateReturnColumnIndexes() throws
631
632
632
633
@ Test
633
634
public void testPreparedStatementExecute () throws SQLException {
634
- try (Connection connection = createConnection ()) {
635
+ try (Connection connection = createJdbcConnection ()) {
635
636
verifyPreparedUpdateCount (connection .prepareStatement (dml ), PreparedStatement ::execute , 1L );
636
637
verifyPreparedUpdateCount (
637
638
connection .prepareStatement (largeDml ), PreparedStatement ::execute , LARGE_UPDATE_COUNT );
@@ -651,7 +652,7 @@ public void testPreparedStatementExecute() throws SQLException {
651
652
652
653
@ Test
653
654
public void testPreparedStatementExecuteReturnGeneratedKeys () throws SQLException {
654
- try (Connection connection = createConnection ()) {
655
+ try (Connection connection = createJdbcConnection ()) {
655
656
// TODO: Add tests for RETURN_GENERATED_KEYS when that is supported.
656
657
verifyPreparedUpdateCount (
657
658
connection .prepareStatement (dml , Statement .NO_GENERATED_KEYS ),
@@ -683,7 +684,7 @@ public void testPreparedStatementExecuteReturnGeneratedKeys() throws SQLExceptio
683
684
684
685
@ Test
685
686
public void testPreparedStatementExecuteReturnColumnNames () throws SQLException {
686
- try (Connection connection = createConnection ()) {
687
+ try (Connection connection = createJdbcConnection ()) {
687
688
verifyPreparedUpdateCount (
688
689
connection .prepareStatement (dml , new String [] {"id" }), PreparedStatement ::execute , 1L );
689
690
verifyPreparedUpdateCount (
@@ -711,7 +712,7 @@ public void testPreparedStatementExecuteReturnColumnNames() throws SQLException
711
712
712
713
@ Test
713
714
public void testPreparedStatementExecuteReturnColumnIndexes () throws SQLException {
714
- try (Connection connection = createConnection ()) {
715
+ try (Connection connection = createJdbcConnection ()) {
715
716
verifyPreparedUpdateCount (
716
717
connection .prepareStatement (dml , new int [] {1 }), PreparedStatement ::execute , 1L );
717
718
verifyPreparedUpdateCount (
0 commit comments