Browse Source

Make <sql> ignore empty "statements".

Submitted by:	Jose  Alberto Fernandez <JFernandez@viquity.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268072 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 25 years ago
parent
commit
e2bb645b67
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java

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

@@ -482,6 +482,9 @@ public class SQLExec extends Task {
* Exec the sql statement.
*/
protected void execSQL(String sql) throws SQLException {
// Check and ignore empty statements
if ("".equals(sql.trim())) return;
try {
totalSql++;
if (!statement.execute(sql)) {
@@ -585,13 +588,13 @@ public class SQLExec extends Task {

private void runTransaction() throws IOException, SQLException {
if (tSqlCommand.length() != 0) {
log("Executing commands", Project.MSG_VERBOSE);
log("Executing commands", Project.MSG_INFO);
runStatements(new StringReader(tSqlCommand));
}
if (tSrcFile != null) {
log("Executing file: " + tSrcFile.getAbsolutePath(),
Project.MSG_VERBOSE);
Project.MSG_INFO);
runStatements(new FileReader(tSrcFile));
}
}


Loading…
Cancel
Save