Skip to content

Commit

Permalink
Merge pull request mybatis#241 from thekonz/master
Browse files Browse the repository at this point in the history
Added DELIMITER support in jdbc script runner
  • Loading branch information
emacarron committed Feb 22, 2015
2 parents b54480c + 89f1dd1 commit 182e5f7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/apache/ibatis/jdbc/ScriptRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ private void checkForMissingLineTerminator(StringBuilder command) {

private StringBuilder handleLine(StringBuilder command, String line) throws SQLException, UnsupportedEncodingException {
String trimmedLine = line.trim();
if (trimmedLine.toUpperCase().startsWith("DELIMITER")) {
delimiter = trimmedLine.substring(10).trim();
return command;
}
if (lineIsComment(trimmedLine)) {
println(trimmedLine);
} else if (commandReadyToExecute(trimmedLine)) {
Expand Down

0 comments on commit 182e5f7

Please sign in to comment.