/** * Prepares for execution by setting the initial state, such as * getting the <code>Connection</code> */ public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }
public UpdateTagSupport() { super(); init(); }
public int doStartTag() throws JspException { if (dataSourceEL != null) { rawDataSource = (Object) ExpressionEvaluatorManager.evaluate("dataSource", dataSourceEL, Object.class, this, pageContext); } if (sqlEL != null) { sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, String.class, this, pageContext); } return super.doStartTag(); } }
private Connection getConnection() throws JspException, SQLException { // Fix: Add all other mechanisms Connection conn = null; isPartOfTransaction = false; TransactionTagSupport parent = (TransactionTagSupport) findAncestorWithClass(this, TransactionTagSupport.class); if (parent != null) { if (dataSourceSpecified) { throw new JspTagException( Resources.getMessage("ERROR_NESTED_DATASOURCE")); } conn = parent.getSharedConnection(); isPartOfTransaction = true; } else { if ((rawDataSource == null) && dataSourceSpecified) { throw new JspException( Resources.getMessage("SQL_DATASOURCE_NULL")); } DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, pageContext); try { conn = dataSource.getConnection(); } catch (Exception ex) { throw new JspException( Resources.getMessage("DATASOURCE_INVALID", ex.toString())); } } return conn; }
try { PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate();
public int doStartTag() throws JspException { if (dataSourceEL != null) { rawDataSource = (Object) ExpressionEvaluatorManager.evaluate("dataSource", dataSourceEL, Object.class, this, pageContext); } if (sqlEL != null) { sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, String.class, this, pageContext); } return super.doStartTag(); } }
private Connection getConnection() throws JspException, SQLException { // Fix: Add all other mechanisms Connection conn = null; isPartOfTransaction = false; TransactionTagSupport parent = (TransactionTagSupport) findAncestorWithClass(this, TransactionTagSupport.class); if (parent != null) { if (dataSourceSpecified) { throw new JspTagException( Resources.getMessage("ERROR_NESTED_DATASOURCE")); } conn = parent.getSharedConnection(); isPartOfTransaction = true; } else { if ((rawDataSource == null) && dataSourceSpecified) { throw new JspException( Resources.getMessage("SQL_DATASOURCE_NULL")); } DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, pageContext); try { conn = dataSource.getConnection(); } catch (Exception ex) { throw new JspException( Resources.getMessage("DATASOURCE_INVALID", ex.toString())); } } return conn; }
try { PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate();
@Override public int doStartTag() throws JspException { rawDataSource = ExpressionUtil.evaluate(dataSourceExpression, pageContext); sql = ExpressionUtil.evaluate(sqlExpression, pageContext); return super.doStartTag(); }
/** * Prepares for execution by setting the initial state, such as * getting the <code>Connection</code> */ public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }
public UpdateTagSupport() { super(); init(); }
private Connection getConnection() throws JspException, SQLException { // Fix: Add all other mechanisms Connection conn = null; isPartOfTransaction = false; TransactionTagSupport parent = (TransactionTagSupport) findAncestorWithClass(this, TransactionTagSupport.class); if (parent != null) { if (dataSourceSpecified) { throw new JspTagException( Resources.getMessage("ERROR_NESTED_DATASOURCE")); } conn = parent.getSharedConnection(); isPartOfTransaction = true; } else { if ((rawDataSource == null) && dataSourceSpecified) { throw new JspException( Resources.getMessage("SQL_DATASOURCE_NULL")); } DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, pageContext); try { conn = dataSource.getConnection(); } catch (Exception ex) { throw new JspException( Resources.getMessage("DATASOURCE_INVALID", ex.toString())); } } return conn; }
try { PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate();
public int doStartTag() throws JspException { if (dataSourceEL != null) { rawDataSource = (Object) ExpressionEvaluatorManager.evaluate("dataSource", dataSourceEL, Object.class, this, pageContext); } if (sqlEL != null) { sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, String.class, this, pageContext); } return super.doStartTag(); } }
/** * Prepares for execution by setting the initial state, such as * getting the <code>Connection</code> */ public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }
public UpdateTagSupport() { super(); init(); }
private Connection getConnection() throws JspException, SQLException { // Fix: Add all other mechanisms Connection conn = null; isPartOfTransaction = false; TransactionTagSupport parent = (TransactionTagSupport) findAncestorWithClass(this, TransactionTagSupport.class); if (parent != null) { if (dataSourceSpecified) { throw new JspTagException( Resources.getMessage("ERROR_NESTED_DATASOURCE")); } conn = parent.getSharedConnection(); isPartOfTransaction = true; } else { if ((rawDataSource == null) && dataSourceSpecified) { throw new JspException( Resources.getMessage("SQL_DATASOURCE_NULL")); } DataSource dataSource = DataSourceUtil.getDataSource(rawDataSource, pageContext); try { conn = dataSource.getConnection(); } catch (Exception ex) { throw new JspException( Resources.getMessage("DATASOURCE_INVALID", ex.toString())); } } return conn; }
try { PreparedStatement ps = conn.prepareStatement(sqlStatement); setParameters(ps, parameters); result = ps.executeUpdate(); ps.close();
public int doStartTag() throws JspException { if (dataSourceEL != null) { rawDataSource = (Object) ExpressionEvaluatorManager.evaluate("dataSource", dataSourceEL, Object.class, this, pageContext); } if (sqlEL != null) { sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, String.class, this, pageContext); } return super.doStartTag(); } }
/** * Prepares for execution by setting the initial state, such as * getting the <code>Connection</code> */ public int doStartTag() throws JspException { try { conn = getConnection(); } catch (SQLException e) { throw new JspException(sql + ": " + e.getMessage(), e); } return EVAL_BODY_BUFFERED; }