Skip to content

Commit

Permalink
test for comment
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Dec 7, 2007
1 parent fa0f233 commit 685c2eb
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions symmetric/src/main/java/org/jumpmind/symmetric/db/SqlScript.java
Expand Up @@ -89,25 +89,27 @@ private void executeScript(Statement st) throws SQLException {
String line;
StringBuilder sql = new StringBuilder();

while ((line = reader.readLine()) != null && ! isComment(line)) {
if (checkStatementEnds(line)) {
sql.append(line.substring(0, line.indexOf(delimiter)));
if (logger.isDebugEnabled()) {
logger.debug("query->" + sql);
}
try {
st.execute(sql.toString());
} catch (SQLException e) {
if (failOnError) {
logger.error(sql.toString() + " failed to execute.", e);
throw e;
} else {
logger.warn(e.getMessage() + ": " + sql.toString());
while ((line = reader.readLine()) != null) {
if (! isComment(line)) {
if (checkStatementEnds(line)) {
sql.append(line.substring(0, line.indexOf(delimiter)));
if (logger.isDebugEnabled()) {
logger.debug("query->" + sql);
}
try {
st.execute(sql.toString());
} catch (SQLException e) {
if (failOnError) {
logger.error(sql.toString() + " failed to execute.", e);
throw e;
} else {
logger.warn(e.getMessage() + ": " + sql.toString());
}
}
sql.setLength(0);
} else {
sql.append(line);
}
sql.setLength(0);
} else {
sql.append(line);
}
}
} catch (IOException e) {
Expand Down

0 comments on commit 685c2eb

Please sign in to comment.