org.objectweb.cjdbc.controller.connection
Class SimpleConnectionManager

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.connection.AbstractConnectionManager
      extended byorg.objectweb.cjdbc.controller.connection.SimpleConnectionManager
All Implemented Interfaces:
java.io.Serializable

public class SimpleConnectionManager
extends AbstractConnectionManager
implements java.io.Serializable

This connection manager creates a new Connection every time the getConnection() method is called.

Version:
1.0
Author:
Emmanuel Cecchet, Nicolas Modrzyk
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager
backendName, backendUrl, initialized, logger, rLogin, rPassword
 
Constructor Summary
SimpleConnectionManager(java.lang.String backendUrl, java.lang.String backendName, java.lang.String login, java.lang.String password)
          Creates a new SimpleConnectionManager instance.
 
Method Summary
 void finalizeConnections()
          Does nothing.
 java.sql.Connection getConnection()
          Gets a new connection from the underlying driver.
 java.lang.String getInformation()
          Gets information about this connection manager
 java.lang.String getXmlInformation()
          Gets xml formatted information on this connection manager
 void initializeConnections()
          Does nothing.
 void releaseConnection(java.sql.Connection connection)
          Closes the connection.
 
Methods inherited from class org.objectweb.cjdbc.controller.connection.AbstractConnectionManager
finalize, getConnection, getLogin, getPassword, isInitialized, releaseConnection, retrieveConnection, setLogin, setPassword
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleConnectionManager

public SimpleConnectionManager(java.lang.String backendUrl,
                               java.lang.String backendName,
                               java.lang.String login,
                               java.lang.String password)
Creates a new SimpleConnectionManager instance.

Parameters:
backendUrl - URL of the DatabaseBackend owning this connection manager.
backendName - name of the DatabaseBackend owning this connection manager.
login - backend connection login to be used by this connection manager.
password - backend connection password to be used by this connection manager.
Method Detail

initializeConnections

public void initializeConnections()
                           throws java.sql.SQLException
Does nothing.

Specified by:
initializeConnections in class AbstractConnectionManager
Throws:
java.sql.SQLException - if an error occurs.
See Also:
AbstractConnectionManager.initializeConnections()

finalizeConnections

public void finalizeConnections()
                         throws java.sql.SQLException
Does nothing.

Specified by:
finalizeConnections in class AbstractConnectionManager
Throws:
java.sql.SQLException - if an error occurs.
See Also:
AbstractConnectionManager.finalizeConnections()

getConnection

public java.sql.Connection getConnection()
Gets a new connection from the underlying driver.

Specified by:
getConnection in class AbstractConnectionManager
Returns:
a Connection or null if no connection is available or if the connection has not been initialized.
See Also:
AbstractConnectionManager.getConnection()

releaseConnection

public void releaseConnection(java.sql.Connection connection)
Closes the connection.

Specified by:
releaseConnection in class AbstractConnectionManager
Parameters:
connection - the connection to release.
See Also:
AbstractConnectionManager.releaseConnection(Connection)

getXmlInformation

public java.lang.String getXmlInformation()
Description copied from class: AbstractConnectionManager
Gets xml formatted information on this connection manager

Specified by:
getXmlInformation in class AbstractConnectionManager
Returns:
xml formatted string that conforms to c-jdbc.dtd
See Also:
AbstractConnectionManager.getXmlInformation()

getInformation

public java.lang.String getInformation()
Description copied from class: AbstractConnectionManager
Gets information about this connection manager

Specified by:
getInformation in class AbstractConnectionManager
Returns:
a String value containing information.
See Also:
AbstractConnectionManager.getInformation()


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.