org.apache.commons.jelly.tags.sql
Class SqlTagSupport

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.sql.SqlTagSupport
All Implemented Interfaces:
javax.servlet.jsp.jstl.sql.SQLExecutionTag, org.apache.commons.jelly.Tag
Direct Known Subclasses:
QueryTag, UpdateTag

public abstract class SqlTagSupport
extends org.apache.commons.jelly.TagSupport
implements javax.servlet.jsp.jstl.sql.SQLExecutionTag

Abstract base class for any SQL related tag in JSTL.

Author:
Hans Bergsten, Justyna Horwat, James Strachan

Field Summary
protected  boolean dataSourceSpecified
           
protected  boolean isPartOfTransaction
           
protected  java.lang.Object rawDataSource
           
protected  java.lang.String scope
           
protected  java.lang.String sql
           
protected  java.lang.String var
           
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
SqlTagSupport()
           
 
Method Summary
 void addSQLParameter(java.lang.Object o)
          Called by nested parameter elements to add PreparedStatement parameter values.
protected  void clearParameters()
           
protected  java.sql.Connection getConnection()
           
protected  boolean hasParameters()
           
 void setDataSource(java.lang.Object dataSource)
          Sets the SQL DataSource.
protected  void setParameters(java.sql.PreparedStatement ps)
           
 void setScope(java.lang.String scopeName)
          Sets the scope of the variable to hold the result.
 void setSql(java.lang.String sql)
          Sets the SQL statement to use for the query.
 void setVar(java.lang.String var)
          Sets the name of the variable to hold the result.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
doTag
 

Field Detail

var

protected java.lang.String var

scope

protected java.lang.String scope

rawDataSource

protected java.lang.Object rawDataSource

dataSourceSpecified

protected boolean dataSourceSpecified

sql

protected java.lang.String sql

isPartOfTransaction

protected boolean isPartOfTransaction
Constructor Detail

SqlTagSupport

public SqlTagSupport()
Method Detail

setVar

public void setVar(java.lang.String var)
Sets the name of the variable to hold the result.


setScope

public void setScope(java.lang.String scopeName)
Sets the scope of the variable to hold the result.


setDataSource

public void setDataSource(java.lang.Object dataSource)
Sets the SQL DataSource. DataSource can be a String or a DataSource object.


setSql

public void setSql(java.lang.String sql)
Sets the SQL statement to use for the query. The statement may contain parameter markers (question marks, ?). If so, the parameter values must be set using nested value elements.


addSQLParameter

public void addSQLParameter(java.lang.Object o)
Called by nested parameter elements to add PreparedStatement parameter values.

Specified by:
addSQLParameter in interface javax.servlet.jsp.jstl.sql.SQLExecutionTag

hasParameters

protected boolean hasParameters()
Returns:
true if there are SQL parameters

clearParameters

protected void clearParameters()

getConnection

protected java.sql.Connection getConnection()
                                     throws org.apache.commons.jelly.JellyTagException,
                                            java.sql.SQLException
Throws:
org.apache.commons.jelly.JellyTagException
java.sql.SQLException

setParameters

protected void setParameters(java.sql.PreparedStatement ps)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.