edu.jhu.tmaj.database.conn
Interface ConnectionManager

All Known Implementing Classes:
PooledConnectionManager

public interface ConnectionManager

Interface for managing connections to the database. Since initiating a connection to the database takes a relatively long time, database connections should not be simply created and destroyed each time a new query is done. In addition, since sometimes multiple clients access the server at the same time, there should be more than simply one connection serving them all.


Method Summary
 java.sql.Connection getConnection()
          Returns a valid connection to the database.
 void returnConnection(java.sql.Connection connection)
          Gives a connection back to the ConnectionFactory telling indicating the connection can be re-issued.
 

Method Detail

getConnection

java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Returns a valid connection to the database. The connection should be tested and if there is an error, an attempt to replace the connection should be made.

Returns:
valid database connection
Throws:
java.sql.SQLException - if there an error getting the connection

returnConnection

void returnConnection(java.sql.Connection connection)
Gives a connection back to the ConnectionFactory telling indicating the connection can be re-issued. This method only has meaning in PooledConnectionManager