[ 1811965 ] Import of SQLStatement fails if line ends with ;

This commit is contained in:
Heng Sin Low 2007-12-17 16:55:29 +00:00
parent f5f50da2f4
commit 6c301fe4cf
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ public class SQLStatementElementHandler extends AbstractElementHandler {
log.info(elementValue);
Attributes atts = element.attributes;
String DBType = atts.getValue("DBType");
PreparedStatement pstmt = DB.prepareStatement(atts.getValue("statement"), getTrxName(ctx));
String sql = atts.getValue("statement").trim();
if (sql.endsWith(";"))
sql = sql.substring(0, sql.length() - 1);
PreparedStatement pstmt = DB.prepareStatement(sql, getTrxName(ctx));
try {
if(DBType.equals("ALL")) {
int n = pstmt.executeUpdate();