Methods Summary |
---|
public int | doStartTag()
DataSourceWrapper ds = new DataSourceWrapper();
try {
ds.setDriverClassName(getDriverClassName());
}
catch (Exception e) {
throw new JspTagException("Invalid driver class name: " +
e.toString(), e);
}
ds.setJdbcURL(getJdbcURL());
ds.setUserName(getUserName());
ds.setPassword(getPassword());
pageContext.setAttribute(var, ds, scope);
return SKIP_BODY;
|
private java.lang.String | getDriverClassName()
if (driverClassName != null) {
return driverClassName;
}
ServletContext application = pageContext.getServletContext();
return application.getInitParameter(DRIVER_CLASS_NAME);
|
private java.lang.String | getJdbcURL()
if (jdbcURL != null) {
return jdbcURL;
}
ServletContext application = pageContext.getServletContext();
return application.getInitParameter(JDBC_URL);
|
private java.lang.String | getPassword()
ServletContext application = pageContext.getServletContext();
return application.getInitParameter(PASSWORD);
|
private java.lang.String | getUserName()
if (userName != null) {
return userName;
}
ServletContext application = pageContext.getServletContext();
return application.getInitParameter(USER_NAME);
|
public void | setDriver(java.lang.String driverClassName)
//*********************************************************************
// Accessor methods
this.driverClassName = driverClassName;
|
public void | setJdbcURL(java.lang.String jdbcURL)
this.jdbcURL = jdbcURL;
|
public void | setScope(java.lang.String scopeName)Setter method for the scope of the variable to hold the
result.
if ("page".equals(scopeName)) {
scope = PageContext.PAGE_SCOPE;
}
else if ("request".equals(scopeName)) {
scope = PageContext.REQUEST_SCOPE;
}
else if ("session".equals(scopeName)) {
scope = PageContext.SESSION_SCOPE;
}
else if ("application".equals(scopeName)) {
scope = PageContext.APPLICATION_SCOPE;
}
|
public void | setUserName(java.lang.String userName)
this.userName = userName;
|
public void | setVar(java.lang.String var)
this.var = var;
|