org.esupportail.cas.server.handlers.database
Class DatabaseServer
java.lang.Object
org.esupportail.cas.server.util.log.Debug
org.esupportail.cas.server.util.Server
org.esupportail.cas.server.handlers.database.DatabaseServer
- Direct Known Subclasses:
- BindDatabaseServer, QueryDatabaseServer
abstract class DatabaseServer
- extends Server
This abstract class implements a database server class, inherited by
BindDatabaseServer and SearchDatabaseServer.
- Author:
- Pascal Aubry
|
Field Summary |
private java.lang.String |
jdbcDriver
The name of the class used to access the database through JDBC. |
private java.lang.String |
jdbcUrl
The JDBC URL of the database. |
|
Method Summary |
protected java.sql.Connection |
connect(java.lang.String bindUsername,
java.lang.String bindPassword)
Connect to a database using specified username and password. |
| Methods inherited from class org.esupportail.cas.server.util.log.Debug |
checkClass, elementDebugValue, isDebug, setDebug, trace, trace, traceBegin, traceEnd, traceEnd, traceEnd, traceThrow |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
jdbcDriver
private java.lang.String jdbcDriver
- The name of the class used to access the database through JDBC.
jdbcUrl
private java.lang.String jdbcUrl
- The JDBC URL of the database.
DatabaseServer
protected DatabaseServer(java.lang.Boolean handlerDebug,
RedundantHandler handler,
org.dom4j.Element serverElement)
throws java.lang.Exception
- Constructor.
- Parameters:
handlerDebug - debugging mode of the handlerhandler - the handler the server will be used byserverElement - the XML element that declares the server
- Throws:
java.lang.Exception - Exception
connect
protected final java.sql.Connection connect(java.lang.String bindUsername,
java.lang.String bindPassword)
- Connect to a database using specified username and password.
- Parameters:
bindUsername - the username to use for the connectionbindPassword - the associated password
- Returns:
- a Connection object on success, null on error (in this case,
the error code can be retrieved with the connectError() method).