org.apache.commons.jelly.tags.sql
Class SqlTagSupport
java.lang.Object
|
+--org.apache.commons.jelly.TagSupport
|
+--org.apache.commons.jelly.tags.sql.SqlTagSupport
- All Implemented Interfaces:
- javax.servlet.jsp.jstl.sql.SQLExecutionTag, Tag
- Direct Known Subclasses:
- QueryTag, UpdateTag
- public abstract class SqlTagSupport
- extends 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
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, getBody, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, 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 |
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
SqlTagSupport
public SqlTagSupport()
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
- Following copied from interface:
javax.servlet.jsp.jstl.sql.SQLExecutionTag
- Parameters:
the
- PreparedStatement parameter value
hasParameters
protected boolean hasParameters()
- Returns:
- true if there are SQL parameters
clearParameters
protected void clearParameters()
getConnection
protected java.sql.Connection getConnection()
throws JellyException,
java.sql.SQLException
setParameters
protected void setParameters(java.sql.PreparedStatement ps)
throws java.sql.SQLException
Copyright © 2002-2002 Apache Software Foundation. All Rights Reserved.