org.gswing.framework.services
Interface IDatabaseManagement

All Known Implementing Classes:
DatabaseManager

public interface IDatabaseManagement

Database connection manager.


Method Summary
 void closeDbConnection()
          Shutdown database connection.
 boolean createDbConnection(String protocol, String databaseName, String userName, String password)
          Create a new connection to the database.
 void deRegister(IDatabaseListener listener)
          De-register with the database manager for update database notification messages.
 IDbReadAccess getReadAccess()
          Get a read access to the database.
 IDbWriteAccess getWriteAccess()
          Get a write access to the database.
 boolean hasBeenInitialised()
          Has this database been initialised?
 boolean isCurrentlyConnected()
          Is the manager currently connected to the database?
 void register(IDatabaseListener listener)
          Register with the database manager for update database notification messages.
 void updateConnectionStatus()
          Inform all connected components of current connection status.
 

Method Detail

createDbConnection

boolean createDbConnection(String protocol,
                           String databaseName,
                           String userName,
                           String password)
Create a new connection to the database.

Parameters:
protocol - The JDBC protocol.
databaseName - The database name.
userName - The database user name.
password - The password for the database.
Returns:
True if a successful connection was created.

closeDbConnection

void closeDbConnection()
Shutdown database connection.


register

void register(IDatabaseListener listener)
Register with the database manager for update database notification messages.

Parameters:
listener - The db listener.

deRegister

void deRegister(IDatabaseListener listener)
De-register with the database manager for update database notification messages.

Parameters:
listener - The db listener.

getReadAccess

IDbReadAccess getReadAccess()
Get a read access to the database.

Returns:
The read access db object.

getWriteAccess

IDbWriteAccess getWriteAccess()
Get a write access to the database.

Returns:
Write access to the database.

isCurrentlyConnected

boolean isCurrentlyConnected()
Is the manager currently connected to the database?

Returns:
connection status.

hasBeenInitialised

boolean hasBeenInitialised()
Has this database been initialised?

Returns:
True if the database has been initialised.

updateConnectionStatus

void updateConnectionStatus()
Inform all connected components of current connection status.



Copyright © 2008. All Rights Reserved.