org.dartra.framework.dao
Interface DataAccessObject

All Known Subinterfaces:
BoardDAO, DartsSetDAO, GameDAO, UserDAO

public interface DataAccessObject

Core interface for all DAO's. Data access objects are created by a DAO factory.

Author:
Erwin Vervaet
See Also:
DAOFactory

Method Summary
 void close()
          Close all resources held by this DAO.
 Connection getConnection()
          Return the connection to the data source used by this DAO.
 DAOFactory getDAOFactory()
          Returns the factory that created this DAO.
 void init(Connection conn)
          Initialize this DAO with given connection to the data source.
 

Method Detail

init

public void init(Connection conn)
          throws DataAccessException

Initialize this DAO with given connection to the data source.

Throws:
DataAccessException

close

public void close()
           throws DataAccessException

Close all resources held by this DAO. After a call to this method, the DAO is no longer usable.

Users should make sure they call the close method in their finally blocks to guarantee that all resources are freed.

Note that this will not close the connection object passed into the init() method. The user of the DAO is responsible for this connection.

Throws:
DataAccessException

getDAOFactory

public DAOFactory getDAOFactory()

Returns the factory that created this DAO.


getConnection

public Connection getConnection()

Return the connection to the data source used by this DAO.