org.jaffa.persistence.engines.jdbcengine.datasource
Interface IConnectionFactory

All Known Implementing Classes:
DbConnectionBrokerConnectionFactory, DbcpDataSourceConnectionFactory, JndiDataSourceConnectionFactory

public interface IConnectionFactory

This is an abstract factory interface for creating connections.

Author:
GautamJ

Method Summary
 Connection createConnection()
          Creates a connection in an implementation specific fashion.
 void freeConnection(Connection connection)
          If the implementation supports connection pooling, returns the connection back to the pool, Otherwise, this will do nothing.
 boolean usePreparedStatementCaching()
          Returns a true if the Prepared (and Call) Statements are to be cached for a connection.
 

Method Detail

createConnection

public Connection createConnection()
                            throws SQLException,
                                   IOException
Creates a connection in an implementation specific fashion.

Returns:
a Connection
Throws:
SQLException - if any SQL error occurs
IOException - if any IO error occurs

freeConnection

public void freeConnection(Connection connection)
                    throws SQLException,
                           IOException
If the implementation supports connection pooling, returns the connection back to the pool, Otherwise, this will do nothing.

Parameters:
connection - The connection to return back to the pool.
Throws:
SQLException - if any SQL error occurs
IOException - if any IO error occurs

usePreparedStatementCaching

public boolean usePreparedStatementCaching()
Returns a true if the Prepared (and Call) Statements are to be cached for a connection.

Returns:
a true if the Prepared (and Call) Statements are to be cached for a connection.


Copyright © 2002-2004 JAFFA Project.