1 19 20 package org.netbeans.modules.db.sql.execute; 21 22 import java.sql.SQLException ; 23 import java.util.Collections ; 24 import java.util.Iterator ; 25 import java.util.List ; 26 import org.openide.ErrorManager; 27 28 33 public class SQLExecutionResults { 34 35 private final List <SQLExecutionResult> results; 36 37 public SQLExecutionResults(List <SQLExecutionResult> results) { 38 this.results = Collections.unmodifiableList(results); 39 } 40 41 public List <SQLExecutionResult> getResults() { 42 return results; 43 } 44 45 public void close() { 46 for (Iterator <SQLExecutionResult> i = results.iterator(); i.hasNext();) { 47 try { 48 i.next().close(); 49 } catch (SQLException e) { 50 ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); 51 } 52 } 53 } 54 55 public int size() { 56 return results.size(); 57 } 58 59 public boolean hasExceptions() { 60 for (SQLExecutionResult result: results) { 61 if (result.getException() != null) { 62 return true; 63 } 64 } 65 return false; 66 } 67 } 68 | Popular Tags |