class JDBC {

    public HashMap[] processQuery(String sqlQuery) throws VantiqSQLException {
        HashMap[] rsArray = null;

        if (isAsync) {
            try (Connection conn = ds.getConnection();
                 Statement stmt = conn.createStatement();
                 ResultSet rs = stmt.executeQuery(sqlQuery)) {
                rsArray = createMapFromResults(rs);
            } catch (SQLException e) {
                // Handle errors for JDBC
                reportSQLError(e);
            }
        } else {
            // Check that connection hasn't closed
            diagnoseConnection();

            try (Statement stmt = conn.createStatement();
                 ResultSet rs = stmt.executeQuery(sqlQuery)) {
                rsArray = createMapFromResults(rs);
            } catch (SQLException e) {
                // Handle errors for JDBC
                reportSQLError(e);
            }
        }

        return rsArray;
    }

}