![JAR search and dependency download from the Maven repository](/logo.png)
org.milyn.routing.db.StatementExec Maven / Gradle / Ivy
/*
Milyn - Copyright (C) 2006 - 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (version 2.1) as published by the Free Software
Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.routing.db;
import org.milyn.assertion.AssertArgument;
import org.milyn.cdr.SmooksConfigurationException;
import org.milyn.util.DollarBraceDecoder;
import org.milyn.util.MVELTemplate;
import org.milyn.xml.XmlUtil;
import org.milyn.javabean.expression.BeanMapExpressionEvaluator;
import java.sql.*;
import java.util.*;
/**
* SQL Statement Executor.
*
* @author [email protected]
*/
public class StatementExec {
private String statement;
private StatementType statementType;
private boolean isJoin;
private List statementExpressionEvaluators = new ArrayList();
private MVELTemplate updateStatementTemplate;
public StatementExec(String statementString) throws SmooksConfigurationException {
AssertArgument.isNotNull(statementString, "statementString");
statement = XmlUtil.removeEntities(statementString).trim();
if (statement.toLowerCase().startsWith("select")) {
statementType = StatementType.QUERY;
} else {
statementType = StatementType.UPDATE;
updateStatementTemplate = new MVELTemplate(statement);
}
// The input payload can be a List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy