@@ -679,7 +679,9 @@ public void testBooleanTypes() throws SQLException {
679679 @ Test (groups = { "integration" })
680680 public void testArrayTypes () throws SQLException {
681681 runQuery ("CREATE TABLE test_arrays (order Int8, "
682- + "array Array(Int8), arraystr Array(String), arraytuple Array(Tuple(Int8, String)), arraydate Array(Date)"
682+ + "array Array(Int8), arraystr Array(String), "
683+ + "arraytuple Array(Tuple(Int8, String)), "
684+ + "arraydate Array(Date)"
683685 + ") ENGINE = MergeTree ORDER BY ()" );
684686
685687 // Insert random (valid) values
@@ -707,7 +709,7 @@ public void testArrayTypes() throws SQLException {
707709 arraydate [i ] = Date .valueOf (LocalDate .now ().plusDays (rand .nextInt (100 )));
708710 }
709711
710- // Insert random (valid) values
712+ // Insert using `Connection#createArrayOf`
711713 try (Connection conn = getConnection ()) {
712714 try (PreparedStatement stmt = conn .prepareStatement ("INSERT INTO test_arrays VALUES ( 1, ?, ?, ?, ?)" )) {
713715 stmt .setArray (1 , conn .createArrayOf ("Int8" , array ));
@@ -718,6 +720,18 @@ public void testArrayTypes() throws SQLException {
718720 }
719721 }
720722
723+ // Insert using common java objects
724+ final String INSERT_SQL = "INSERT INTO test_arrays VALUES ( 1, ?, ?, ?, ?)" ;
725+ try (Connection conn = getConnection ()) {
726+ try (PreparedStatement stmt = conn .prepareStatement (INSERT_SQL )) {
727+ stmt .setObject (1 , array );
728+ stmt .setObject (2 , arraystr );
729+ stmt .setObject (3 , arraytuple );
730+ stmt .setObject (4 , arraydate );
731+ stmt .executeUpdate ();
732+ }
733+ }
734+
721735 // Check the results
722736 try (Connection conn = getConnection ()) {
723737 try (Statement stmt = conn .createStatement ()) {
0 commit comments