net.agmodel.genericBroker
Interface DBAccessMechanism


public interface DBAccessMechanism

Defines general operations on a database.
Separate methods are used for connections for data and metadata because in a number of cases these are stored on different machines in different formats.


Method Summary
 boolean connectForData(String username, String password)
          Called before data is retrieved from the AccessMechanism
 boolean connectForMetaData(String username, String password)
          Called before metadata is retrieved from the AccessMechanism
 void disconnectFromData()
          Called after data is retrieved from the AccessMechanism using connectForData.
 void disconnectFromMetaData()
          Called after meta data is retrieved from the AccessMechanism using connectForMetaData.
 

Method Detail

connectForData

public boolean connectForData(String username,
                              String password)
                       throws ConnectionException
Called before data is retrieved from the AccessMechanism

Parameters:
username - a valid username for the database if it requires it, or null otherwise.
password - the corresponding password (not encrypted) if required, or null otherwise.
Returns:
true if the connection was established, false otherwise
Throws:
ConnectionException - if a connection could not be established

disconnectFromData

public void disconnectFromData()
                        throws ConnectionException
Called after data is retrieved from the AccessMechanism using connectForData.

Throws:
ConnectionException - if a connection could not be disconnected

connectForMetaData

public boolean connectForMetaData(String username,
                                  String password)
                           throws ConnectionException
Called before metadata is retrieved from the AccessMechanism

Parameters:
username - a valid username for the database if it requires it, or null otherwise.
password - the corresponding password (not encrypted) if required, or null otherwise.
Returns:
true if the connection was established, false otherwise
Throws:
ConnectionException - if a connection could not be established

disconnectFromMetaData

public void disconnectFromMetaData()
                            throws ConnectionException
Called after meta data is retrieved from the AccessMechanism using connectForMetaData.

Throws:
ConnectionException - if a connection could not be disconnected