private HikariDataSource verifyCharacterSet(String jdbcUrl) throws SQLException {
        HikariDataSource dataSource = getDataSource(jdbcUrl, 1);
        boolean result = new QueryRunner(dataSource)
            .query(
                "SHOW VARIABLES LIKE 'character\\_set\\_connection'",
                rs -> {
                    rs.next();
                    String resultSetString = rs.getString(2);
                    assertThat(resultSetString)
                        .as("Passing query parameters to set DB connection encoding is successful")
                        .startsWith("utf8");
                    return true;
                }
            );

        assertThat(result).as("The database returned a record as expected").isTrue();
        return dataSource;
    }
This method intentionally verifies encoding twice to ensure that the query string parameters are used when
Connections are created from cached containers.

@param jdbcUrl
@throws SQLException
modules/jdbc-test/src/main/java/org/testcontainers/jdbc/AbstractJDBCDriverTest.java