com.ora.jsp.tags.sql
Class UseDataSourceTag
java.lang.Object
|
+--javax.servlet.jsp.tagext.TagSupport
|
+--com.ora.jsp.tags.sql.UseDataSourceTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.Tag
- public class UseDataSourceTag
- extends javax.servlet.jsp.tagext.TagSupport
This class is a custom action for making the JDBC 1.0 DriverManager
available to the other Database actions as a JDBC 2.0 SE DataSource,
saved in the application scope.
It's intended to be used only during development. In production,
it's much more efficient to let an application init servlet make
a DataSource that implements a connection pool available to the
other actions.
- Version:
- 1.0
- Author:
- Hans Bergsten, Gefion software
- See Also:
- Serialized Form
Field Summary |
private java.lang.String |
driverClassName
|
private java.lang.String |
id
|
private java.lang.String |
pw
|
private java.lang.String |
url
|
private java.lang.String |
user
|
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
pageContext, parent, values |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Method Summary |
int |
doEndTag()
Creates a DataSourceWrapper and saves it in the application
scope, unless one is already available. |
void |
release()
Releases all instance variables. |
void |
setClassName(java.lang.String driverClassName)
Sets the JDBC driver class name. |
void |
setId(java.lang.String id)
Sets the id, i.e. |
void |
setPw(java.lang.String pw)
Sets the database account password, if needed. |
void |
setUrl(java.lang.String url)
Sets the JDBC URL. |
void |
setUser(java.lang.String user)
Sets the database account name, if needed. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doStartTag, 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 |
id
private java.lang.String id
driverClassName
private java.lang.String driverClassName
url
private java.lang.String url
user
private java.lang.String user
pw
private java.lang.String pw
UseDataSourceTag
public UseDataSourceTag()
setId
public void setId(java.lang.String id)
- Sets the id, i.e. the name to use for the DataSource
in one of the JSP scopes.
- Overrides:
setId
in class javax.servlet.jsp.tagext.TagSupport
setClassName
public void setClassName(java.lang.String driverClassName)
- Sets the JDBC driver class name.
setUrl
public void setUrl(java.lang.String url)
- Sets the JDBC URL.
setUser
public void setUser(java.lang.String user)
- Sets the database account name, if needed.
setPw
public void setPw(java.lang.String pw)
- Sets the database account password, if needed.
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Creates a DataSourceWrapper and saves it in the application
scope, unless one is already available.
- Overrides:
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
release
public void release()
- Releases all instance variables.
- Overrides:
release
in class javax.servlet.jsp.tagext.TagSupport