PAJES 2.3.9

org.pajes.servlet
Class DataAccessPajeServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.pajes.servlet.PajeServlet
              extended byorg.pajes.servlet.DataAccessPajeServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AuthenticatedPajeServlet, Initialisation

public abstract class DataAccessPajeServlet
extends PajeServlet

Base class for all servlets that utilise the PAJES servlet framework that require data access services.

This class does NOT authenticate access to resources. If authentication is required, sub-class AuthenticatedPajeServlet instead, or use the authentication services of the servlet container.

As with "standard" servlets, sub-classes should implement the doGet or doPost method.

See Also:
Serialized Form

Constructor Summary
DataAccessPajeServlet()
           
 
Method Summary
 java.sql.Connection getDBConnection()
          Convenience method to return a free database connection from the default connection pool.
 java.sql.Connection getDBConnection(java.lang.String poolName)
          Convenience method to return a free database connection from the named connection pool.
 ConnectionManager getDBConnectionPoolManager()
          Convenience method to return the ConnectionManager that manages the defined connection pools available in this ServletContext.
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Over-rides the HttpServlet service method to provide automatic handling of database connections that were not correctly released.
 
Methods inherited from class org.pajes.servlet.PajeServlet
createPaje, createPaje, createPaje, doGet, doPost, getAbsoluteHREF, getBaseHREF, getMaxFileUploadSize, getPajeFactory, getResource, getUploadedFile, getUploadedFileNames, handleException, init, log, log, setInputFieldsFromRequestAttributes, setInputFieldsFromRequestParameters, setMaxFileUploadSize, setPajeFactory
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataAccessPajeServlet

public DataAccessPajeServlet()
Method Detail

getDBConnection

public java.sql.Connection getDBConnection()
                                    throws java.sql.SQLException
Convenience method to return a free database connection from the default connection pool.

Returns:
a database Connection object.
Throws:
java.sql.SQLException - if an error occurs whilst accessing the database.

getDBConnection

public java.sql.Connection getDBConnection(java.lang.String poolName)
                                    throws java.sql.SQLException
Convenience method to return a free database connection from the named connection pool.

Parameters:
poolName - the name of the connection pool to use.
Returns:
a database Connection object.
Throws:
java.sql.SQLException - if an error occurs whilst accessing the database.

getDBConnectionPoolManager

public ConnectionManager getDBConnectionPoolManager()
Convenience method to return the ConnectionManager that manages the defined connection pools available in this ServletContext.

Returns:
the ConnectionManager instance.

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException,
                       javax.servlet.ServletException
Over-rides the HttpServlet service method to provide automatic handling of database connections that were not correctly released.

Overrides:
service in class PajeServlet
Parameters:
request - the object that contains the request the client made of the servlet.
response - the object that contains the response the servlet returns to the client.
Throws:
java.io.IOException - if an input or output error is detected when the servlet handles the request.
javax.servlet.ServletException - if the request could not be handled.

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.