Browse Source

Avoid calling getResultSet() multiple times when printing just in case Informix does not like it. This was per suggestion of Bohuslav Roztocil.

PR: 27162


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277018 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 20 years ago
parent
commit
be45954b98
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java

+ 4
- 5
src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -527,7 +527,7 @@ public class SQLExec extends JDBCTask {
}
} else {
if (print) {
printResults(out);
printResults(resultSet, out);
}
}
ret = statement.getMoreResults();
@@ -563,13 +563,12 @@ public class SQLExec extends JDBCTask {
}

/**
* print any results in the statement.
* print any results in the result set.
* @param rs the resultset to print information about
* @param out the place to print results
* @throws SQLException on SQL problems.
*/
protected void printResults(PrintStream out) throws SQLException {
ResultSet rs = null;
rs = statement.getResultSet();
protected void printResults(ResultSet rs, PrintStream out) throws SQLException {
if (rs != null) {
log("Processing new result set.", Project.MSG_VERBOSE);
ResultSetMetaData md = rs.getMetaData();


Loading…
Cancel
Save