class JDBC {

    public int processPublish(String sqlQuery) throws VantiqSQLException {
        int publishSuccess = -1;

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

            try (Statement stmt = conn.createStatement()) {
                publishSuccess = stmt.executeUpdate(sqlQuery);
            } catch (SQLException e) {
                // Handle errors for JDBC
                reportSQLError(e);
            }
        }

        return publishSuccess;
    }

}