de.mguennewig.pobjects.jdbc
Class ContainerPool

java.lang.Object
  extended by de.mguennewig.pobjects.jdbc.ContainerPool
Direct Known Subclasses:
BasicContainerPool, JndiContainerPool

public abstract class ContainerPool
extends java.lang.Object

Abstract base class for a JDBC container pool.

Author:
Michael Günnewig

Method Summary
 void freeConnection(JdbcContainer db)
          Frees only the connection and puts it back to the pool, but not the container itself
 void freeContainer(JdbcContainer db)
          Frees the container and its connection and puts them back to the pool.
 void getConnection(JdbcContainer db)
          Retrieves a new connection and assigns it to the container.
 JdbcContainer getContainer()
          Retrieves a new container from the pool.
 PObjDictionary getDictionary()
          Returns the dictionary that every container of this pool is using.
 java.lang.String getSchema()
          Returns the schema that every container of this pool is using.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContainer

public final JdbcContainer getContainer()
                                 throws java.sql.SQLException
Retrieves a new container from the pool.

Throws:
java.sql.SQLException - if any database error occurs.

getDictionary

public final PObjDictionary getDictionary()
Returns the dictionary that every container of this pool is using.


getSchema

public final java.lang.String getSchema()
Returns the schema that every container of this pool is using.


freeConnection

public final void freeConnection(JdbcContainer db)
                          throws java.sql.SQLException
Frees only the connection and puts it back to the pool, but not the container itself

Throws:
java.sql.SQLException - if any database error occurs.
See Also:
freeContainer(JdbcContainer)

freeContainer

public final void freeContainer(JdbcContainer db)
                         throws java.sql.SQLException
Frees the container and its connection and puts them back to the pool.

Throws:
java.sql.SQLException - if any database error occurs.
See Also:
freeConnection(JdbcContainer)

getConnection

public final void getConnection(JdbcContainer db)
                         throws java.sql.SQLException
Retrieves a new connection and assigns it to the container.

Throws:
java.lang.IllegalStateException - if the container already has a connection
java.sql.SQLException - if any database error occurs.
See Also:
JdbcContainer.setConnection(java.sql.Connection)