|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet org.apache.commons.scaffold.http.ResourceServlet org.apache.commons.scaffold.http.ConnectionServlet
public class ConnectionServlet
Initialize a ConnectionAdaptor
for this application.
The servlet itself is not involved in managing the connection. The ConnectionAdaptor is a standalone object. This servlet simply provides a means to initialize and load a ConnectionAdaptor for use by your application.
This servlet can be configured to use an alternate adaptor or adaptor key using initialization parameters:
adaptor The default adaptor is
org.apache.scaffold.sql.ConnectionAdaptor
.
Any sublcass of ConnectionAdaptor can be specified instead.
adaptor.key The default adaptor key is DATA_SOURCE
.
Another key can be specified instead. This is the attribute to use
when looking up the datasource in JNDI, the servlet context, or
whatever.
To use the Struts generic connection pool, specify the adaptor as
org.apache.scaffold.sql.ServletAdaptor
and the
adaptor.key as org.apache.struts.action.DATA_SOURCE
To use the Resin connection pool, specify the res-ref-name in the Resin conf as the adaptor.key.
To use Poolman without JNDI, use the Poolman adaptor in the sql package, and specify the dbName from the poolman.xml as the adaptor.key
org.apache.scaffold.sql.ConnectionAdaptor
,
org.apache.scaffold.sql.Servletdaptor
,
org.apache.scaffold.sql.PoolmanAdaptor
,
Serialized FormConstructor Summary | |
---|---|
ConnectionServlet()
|
Method Summary | |
---|---|
protected void |
initDefault()
Initialize the ConnectionAdaptor for this application. |
Methods inherited from class org.apache.commons.scaffold.http.ResourceServlet |
---|
destroy, destroyCustom, destroyDefault, getInitInt, getInitParameters, getInitString, getProperties, init, initCustom, loadProperties, reload, setProperties |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionServlet()
Method Detail |
---|
protected void initDefault() throws IOException, javax.servlet.ServletException
An alternate ConnectionAdaptor can be specified in the servlet config by specifying the class type as the adaptor initialization parameter.
initDefault
in class ResourceServlet
IOException
- if an input/output error is encountered
javax.servlet.ServletException
- if we cannot initialize these resources
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |