stmt.executeUpdate("INSERT INTO arrtest VALUES ('{1,2,3}','{3.1,1.4}', '{abc,f''a,fa\\\"b,def}')");
ResultSet rs = stmt.executeQuery("SELECT intarr, decarr, strarr FROM arrtest");
assertTrue(rs.next());
Array arr = rs.getArray(1);
assertEquals(Types.INTEGER, arr.getBaseType());
ResultSet arrrs = arr.getResultSet();
assertTrue(arrrs.next());
assertEquals(1, arrrs.getInt(1));
assertEquals(1, arrrs.getInt(2));
assertTrue(arrrs.next());
assertEquals(2, arrrs.getInt(1));
assertEquals(2, arrrs.getInt(2));
assertTrue(arrrs.next());
assertEquals(3, arrrs.getInt(1));
assertEquals(3, arrrs.getInt(2));
assertTrue(!arrrs.next());
assertTrue(arrrs.previous());
assertEquals(3, arrrs.getInt(2));
arrrs.first();
assertEquals(1, arrrs.getInt(2));
arrrs.close();
arr = rs.getArray(2);
assertEquals(Types.NUMERIC, arr.getBaseType());
arrrs = arr.getResultSet();
assertTrue(arrrs.next());
assertEquals(new BigDecimal("3.1"), arrrs.getBigDecimal(2));
assertTrue(arrrs.next());
assertEquals(new BigDecimal("1.4"), arrrs.getBigDecimal(2));
arrrs.close();
arr = rs.getArray(3);
assertEquals(Types.VARCHAR, arr.getBaseType());
arrrs = arr.getResultSet(2, 2);
assertTrue(arrrs.next());
assertEquals(2, arrrs.getInt(1));
assertEquals("f'a", arrrs.getString(2));
assertTrue(arrrs.next());
assertEquals(3, arrrs.getInt(1));