Package adams.db
Class AbstractReconnectableDatabaseConnection
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.db.AbstractDatabaseConnection
-
- adams.db.AbstractReconnectableDatabaseConnection
-
- All Implemented Interfaces:
CloneHandler<AbstractDatabaseConnection>
,Destroyable
,LoggingSupporter
,OptionHandler
,PasswordSupporter
,SizeOfHandler
,DatabaseConnectionParameterHandler
,ReconnectableDatabaseConnection
,Serializable
,Comparable<AbstractDatabaseConnection>
public abstract class AbstractReconnectableDatabaseConnection extends AbstractDatabaseConnection implements ReconnectableDatabaseConnection
Ancestor for database connection classes that offer reconnecting to another URL.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.db.AbstractDatabaseConnection
m_AutoCommit, m_ChangeListeners, m_Connection, m_ConnectionOK, m_ConnectOnStartUp, m_Environment, m_Environments, m_FailedConnectAttempts, m_LastConnectionError, m_MaxConnectAttempts, m_OptionManager, m_Owner, m_Password, m_Properties, m_PropertiesCache, m_ReconnectWait, m_URL, m_User, PREFIX_CONNECTION, SUFFIX_COUNT
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReconnectableDatabaseConnection()
Constructor, uses the default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
reconnect(String url, String user, BasePassword password)
Reconnects with the given parameters if they differ from the current settings.-
Methods inherited from class adams.db.AbstractDatabaseConnection
addChangeListener, addConnectionParameters, autoCommitTipText, cleanUpOptions, compareTo, compareTo, configureLogger, connect, connectionsToProperties, connectOnStartUpTipText, createEnvironment, defineOptions, destroy, disconnect, equals, finishInit, getAllConnectionParameters, getAutoCommit, getChangeListeners, getClone, getConnection, getConnectOnStartUp, getCurrentConnectionParameters, getDefaultAutoCommit, getDefaultConnectionParameters, getDefaultConnectOnStartUp, getDefaultLoggingLevel, getDefaultMaxConnectAttempts, getDefaultPassword, getDefaultReconnectWait, getDefaultURL, getDefaultUser, getDefinitionKey, getEnvironment, getFailedConnectAttempt, getFailedConnectAttemptKey, getLastConnectionError, getMaxConnectAttempts, getOptionManager, getOwner, getPassword, getProperties, getReconnectWait, getURL, getUser, hashCode, incFailedConnectAttempt, initialize, isConnected, isConnectionOK, loggingLevelTipText, makeDefaultConnection, maxConnectAttemptsTipText, newConnectionParameters, newOptionManager, notifyChangeListeners, outputChangeListeners, passwordTipText, readProperties, reconnectWaitTipText, removeChangeListener, removeConnectionParameters, resetFailedConnectAttempt, resetFailedConnectAttempt, retryConnect, setAutoCommit, setConnectOnStartUp, setDefaultAutoCommit, setDefaultConnectOnStartUp, setDefaultLoggingLevel, setDefaultPassword, setDefaultURL, setDefaultUser, setLoggingLevel, setMaxConnectAttempts, setOwner, setPassword, setReconnectWait, setURL, setUser, toCommandLine, toConnectionParameters, toString, toStringShort, tryConnection, updateConnectionParameters, URLTipText, userTipText
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
reconnect
public boolean reconnect(String url, String user, BasePassword password)
Reconnects with the given parameters if they differ from the current settings.- Specified by:
reconnect
in interfaceReconnectableDatabaseConnection
- Parameters:
url
- the JDBC URLuser
- the database userpassword
- the database password- Returns:
- true if the reconnect was successful (or not necessary)
-
-