edu.mssm.crover.db.relational
Class RDB

java.lang.Object
  |
  +--edu.mssm.crover.db.relational.RDB

public class RDB
extends java.lang.Object

Relational Database access point. This class is a singleton.


Field Summary
static boolean DEBUG
           
 
Method Summary
 void destroy()
          Deactivates connections to the database.
 java.sql.Connection getConnection()
          Obtain a connection from the pool.
 int getConnectionNumber()
          Returns the current number of open connections.
static RDB getInstance()
          Returns the only instance of RDB available in the system (one per JVM, or zone when used in JServ).
static RDB getInstance(java.lang.String dburl, java.lang.String login, java.lang.String password, java.lang.String driver)
          Returns the only instance of RDB available in the system (one per JVM, or zone when used in JServ).
 Log getLog()
          Returns the log system.
 void log(int level, java.lang.String message)
          Log a message and an exception.
 void log(int level, java.lang.String message, java.lang.Exception e)
          Logs a message and an exception.
static void main(java.lang.String[] args)
          Tests and demonstrates this class behaviour.
 void returnConnection(java.sql.Connection con)
          Returns a connection to the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Method Detail

getConnectionNumber

public int getConnectionNumber()
Returns the current number of open connections. Connections can be open but inactive. This method is useful to test that a given client frees all connections it uses.


getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Obtain a connection from the pool.

java.sql.SQLException

returnConnection

public void returnConnection(java.sql.Connection con)
Returns a connection to the pool.


getInstance

public static RDB getInstance()
Returns the only instance of RDB available in the system (one per JVM, or zone when used in JServ).


getInstance

public static RDB getInstance(java.lang.String dburl,
                              java.lang.String login,
                              java.lang.String password,
                              java.lang.String driver)
Returns the only instance of RDB available in the system (one per JVM, or zone when used in JServ).


log

public void log(int level,
                java.lang.String message,
                java.lang.Exception e)
Logs a message and an exception.

See Also:
Log

log

public void log(int level,
                java.lang.String message)
Log a message and an exception.

See Also:
Log

getLog

public Log getLog()
Returns the log system.


destroy

public void destroy()
Deactivates connections to the database.


main

public static void main(java.lang.String[] args)
Tests and demonstrates this class behaviour.



Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.