@Test
    void testEscaping() throws SQLException {
        final String dirtyValue = "\\_\"_'";
        final String insertBit = "INSERT INTO CHAR_SET_TEST VALUES (";

        try (final Connection connection = getConnection()) {
            // prepared statement escape chars for us
            try (final PreparedStatement preparedStatement = connection.prepareStatement(insertBit + "?)")) {
                preparedStatement.setString(1, dirtyValue);
                preparedStatement.execute();
            }

            // statement runs what it is given so need to escape dirty chars
            final String safeValue = SQLSafe.escapeChars(dirtyValue);
            try (final Statement statement = connection.createStatement()) {
                statement.execute(insertBit + "'" + safeValue + "')");
            }
        }
    }
Test class to explore issues with character sets between Java and MySql.
Currently ignored as most of the tests require human oversight. Left in, in
case it proves useful.
stroom-statistics/stroom-statistics-impl-sql/src/test/java/stroom/statistics/impl/sql/TestMySQLCharacterSets.java