com.ora.jsp.tags.sql
Class UpdateTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--com.ora.jsp.tags.sql.DBTag
                    |
                    +--com.ora.jsp.tags.sql.UpdateTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag, ValueTagParent

public class UpdateTag
extends DBTag

This class is a custom action for executing a SQL INSERT, UPDATE and DELETE statements, as well as SQL DDL statements (e.g. CREATE TABLE). The statement must be defined in the body of the action. It can contain ? place holders, replaced by the value of elements before execution. The number and order of place holders must match the number and order of elements in the body.

Version:
1.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Fields inherited from class com.ora.jsp.tags.sql.DBTag
dataSourceName, id, isExceptionThrown, isPartOfTransaction, scope, sqlCommandBean, sqlValue, values
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext, parent
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
UpdateTag()
           
 
Method Summary
 java.lang.Object execute(SQLCommandBean sqlCommandBean)
          Executes the SQL command as an "update" and returns an Integer with the number of rows affected.
 
Methods inherited from class com.ora.jsp.tags.sql.DBTag
addValue, doAfterBody, doEndTag, doStartTag, getConnection, release, setDataSource, setId, setScope
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

UpdateTag

public UpdateTag()
Method Detail

execute

public java.lang.Object execute(SQLCommandBean sqlCommandBean)
                         throws java.sql.SQLException,
                                UnsupportedTypeException
Executes the SQL command as an "update" and returns an Integer with the number of rows affected.
Overrides:
execute in class DBTag
Parameters:
sqlCommandBean - the SQL command to execute
Returns:
the number of rows affected as an Integer