title: How to check if a Merge query was succesfull in JAVA (ResultSet)?
body: <p>I want to check if this query returns a result or an error. 
  I use the <code>next()</code> method, for <strong>SELECT</strong> querys synce it checks if there's a next row but not sure about <strong>MERGE</strong></p>
  
  <pre><code>public ResultSet example{   
      String sqlQuery = "MERGE INTO bonuses b "
      +"USING ( "
      +"SELECT employee_id, salary, dept_no "
      +"FROM employee@link_to) e "
      +"ON (b.employee_id = e.employee_id) "
      +"WHEN MATCHED THEN "
      +"UPDATE SET b.bonus = e.salary * 0.1 "
      +"WHEN NOT MATCHED THEN "
      +"INSERT (b.employee_id, b.bonus) "
      +"VALUES (e.employee_id, e.salary * 0.05) "
  
      PreparedStatement stmt = conn.prepareStatement(sql);
      ResultSet rs;
      try {
        rs = stmt.executeQuery();
        Err.errN(rs);
      } finally {
  
      }
      return rs;
  }
  </code></pre>