1 16 package org.apache.taglibs.dbtags.preparedstatement; 17 18 import java.sql.PreparedStatement ; 19 import java.sql.SQLException ; 20 21 import javax.servlet.jsp.JspTagException ; 22 23 45 public class SetColumnTag extends BaseSetterBodyTag { 46 47 public int doEndTag() throws JspTagException { 48 49 PreparedStatement statement = getPreparedStatement(); 50 51 try { 52 String string = null; 53 54 if (_attributeName == null) { 55 string = getBodyContent().getString(); 56 } else { 57 string = (String ) getAttribute(_attributeName); 58 } 59 60 statement.setString(_position,string); 61 62 } catch (SQLException e) { 63 throw new JspTagException (e.toString()); 64 } 65 return EVAL_PAGE; 66 } 67 68 } 69 | Popular Tags |