| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(Connection.ConnectionListener listener)
Registers the supplied ConnectionListener to be notified when the status
of the database connection changes.
|
void |
connect()
|
static DbService |
create(String username,
String password,
String dbUrl)
Factory method for creating a DbService instance.
|
void |
disconnect()
Disconnects from
Storage. |
String |
getConnectionUrl() |
void |
removeConnectionListener(Connection.ConnectionListener listener)
Unregisters the supplied ConnectionListener if it was previously
registered via
#addConnectionListener(ConnectionListener). |
public void connect()
throws ConnectionException
DbServiceStorage and registers Storage instance which
was used for the connection as a service.
connect in interface DbServiceConnectionException - If DB connection cannot be established.public void disconnect()
throws ConnectionException
DbServiceStorage.
disconnect in interface DbServiceConnectionExceptionpublic String getConnectionUrl()
getConnectionUrl in interface DbServicepublic static DbService create(String username, String password, String dbUrl) throws StorageException
username - password - dbUrl - StorageException - if no storage provider exists for the given dbUrl.public void addConnectionListener(Connection.ConnectionListener listener)
DbServiceaddConnectionListener in interface DbServicelistener - - the listener to be registeredpublic void removeConnectionListener(Connection.ConnectionListener listener)
DbService#addConnectionListener(ConnectionListener).removeConnectionListener in interface DbServicelistener - - the listener to be unregisteredCopyright © 2013. All Rights Reserved.