1 16 package org.apache.taglibs.dbtags.statement; 17 18 import java.sql.SQLException ; 19 20 import javax.servlet.jsp.JspTagException ; 21 import javax.servlet.jsp.tagext.BodyTagSupport ; 22 23 40 41 public class QueryTag extends BodyTagSupport { 42 43 public int doEndTag() throws JspTagException { 44 try { 45 StatementTag stmtTag = 46 (StatementTag) findAncestorWithClass(this, Class.forName("org.apache.taglibs.dbtags.statement.StatementTag")); 47 stmtTag.setQuery(getBodyContent().getString().trim()); 48 } catch (ClassNotFoundException e) { 49 throw new JspTagException (e.toString()); 50 } catch (SQLException e) { 51 throw new JspTagException (e.toString()); 52 } 53 return EVAL_PAGE; 54 } 55 56 } 57 | Popular Tags |