public int doEndTag() throws PageException {
if(hasChangedPSQ)pageContext.setPsq(orgPSQ);
String strSQL=bodyContent.getString();
// no SQL String defined
if(strSQL.length()==0)
throw new DatabaseException("no sql string defined, inside query tag",null,null,null);
// cannot use attribute params and queryparam tag
if(items.size()>0 && params!=null)
throw new DatabaseException("you cannot use the attribute params and sub tags queryparam at the same time",null,null,null);
// create SQL
SQL sql;
if(params!=null) {
if(Decision.isArray(params))
sql=QueryParamConverter.convert(strSQL, Caster.toArray(params));
else if(Decision.isStruct(params))
sql=QueryParamConverter.convert(strSQL, Caster.toStruct(params));
else
throw new DatabaseException("value of the attribute [params] has to be a struct or a array",null,null,null);
}
else sql=items.size()>0?new SQLImpl(strSQL,items.toArray(new SQLItem[items.size()])):new SQLImpl(strSQL);
railo.runtime.type.Query query=null;
long exe=0;