Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb
Class HypersonicDBServlet  view HypersonicDBServlet download HypersonicDBServlet.java

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.hsqldb.HypersonicDBServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class HypersonicDBServlet
extends javax.servlet.http.HttpServlet

Database Servlet handling the access to the HyperSonic SQL database. Unfortunately, in the current version 1.6.0 of org.hsqldb.Serlvet, the database filename is not configurable, but it has to be set fixed in the constructor. This does not fit to the servlet API. Hence, we import the sourcecode of org.hsqldb.Serlvet in the hope, that this will be fixed in the future.

Created: Sun Nov 12 07:41:51 2000

Version:
$Revision: 1.5 $

Field Summary
private  Database database
           
private  java.lang.String filename
           
private static long iQueries
           
private static long lModified
           
private static java.lang.String sError
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
HypersonicDBServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Delivers the database status.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the database access.
protected  long getLastModified(javax.servlet.http.HttpServletRequest req)
          Always delivers a new integer value.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
protected  void logException(java.lang.Exception e)
          Write the exception stacktrace to the log file of the servlet engine.
private  java.lang.String showStackTrace(java.lang.Exception e)
          Converts the stack trace of the exception to a single String.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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
 

Field Detail

database

private Database database

filename

private java.lang.String filename

sError

private static java.lang.String sError

iQueries

private static long iQueries

lModified

private static long lModified
Constructor Detail

HypersonicDBServlet

public HypersonicDBServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
Initializes the servlet. The following parameters are recognized:
  • filename: local filename of the database.


doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Delivers the database status. This method is a 1:1 copy from org.hsqldb.Serlvet.


doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Handles the database access. The request should be of the form:

<user>+<password>+<SQL command>

This method is a 1:1 copy from org.hsqldb.Serlvet.


getLastModified

protected long getLastModified(javax.servlet.http.HttpServletRequest req)
Always delivers a new integer value. This is made so that the cache of the http server is not used maybe there is some other way.


logException

protected void logException(java.lang.Exception e)
Write the exception stacktrace to the log file of the servlet engine.


showStackTrace

private java.lang.String showStackTrace(java.lang.Exception e)
Converts the stack trace of the exception to a single String.