Class JdbcConnection
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,StateManagedComponent
Implementation of AdaptrisConnectionImp for JDBC.
In the adapter configuration file this class is aliased as jdbc-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInitialise the underlying database connection.booleanForce implementations to over-ride equals with a semantic implementation.protected StringReturns a name for this connection for logging purposes.Returns the connection string to use for this JDBC source.inthashCode()Force implementations to over-ride hashcode.protected voidInitialise the underlying database connection.protected ConnectionMake the connection.voidSets the connection string to use for this JDBC source.protected voidInitialise the underlying database connection.protected voidInitialise the underlying database connection.Methods inherited from class com.adaptris.core.jdbc.DatabaseConnection
alwaysValidateConnection, asDataSource, autoCommit, checkInternalState, closeConnection, connect, connectionProperties, debugMode, getAlwaysValidateConnection, getAutoCommit, getConnectionProperties, getDebugMode, getPassword, getUsername, initConnection, loadDriverClass, prepareConnection, setAlwaysValidateConnection, setAutoCommit, setConnectionProperties, setDebugMode, setPassword, setUsername, startConnection, stopConnectionMethods inherited from class com.adaptris.core.AllowsRetriesConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryIntervalMethods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, connectionStateHandler, getConnectionErrorHandler, getConnectionStateHandler, getRuntimeComponent, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setConnectionStateHandler, setRuntimeComponent, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
Constructor Details
-
JdbcConnection
public JdbcConnection() -
JdbcConnection
Convenience constructor.- Parameters:
url- the URL.driver- the JDBC driver.
-
-
Method Details
-
initialiseDatabaseConnection
Description copied from class:DatabaseConnectionInitialise the underlying database connection.
This abstract method should be implemented by concrete sub-classes to initialise any components other than the DriverManager.
- Specified by:
initialiseDatabaseConnectionin classDatabaseConnection- Throws:
CoreException- wrapping any underlying exception.- See Also:
-
startDatabaseConnection
Description copied from class:DatabaseConnectionInitialise the underlying database connection.
This abstract method should be implemented by concrete sub-classes to initialise any components other than the DriverManager.
- Specified by:
startDatabaseConnectionin classDatabaseConnection- Throws:
CoreException- wrapping any underlying exception.- See Also:
-
stopDatabaseConnection
protected void stopDatabaseConnection()Description copied from class:DatabaseConnectionInitialise the underlying database connection.
This abstract method should be implemented by concrete sub-classes to stop any components other than the DriverManager.
- Specified by:
stopDatabaseConnectionin classDatabaseConnection- See Also:
-
closeDatabaseConnection
protected void closeDatabaseConnection()Description copied from class:DatabaseConnectionInitialise the underlying database connection.
This abstract method should be implemented by concrete sub-classes to close any components.
- Specified by:
closeDatabaseConnectionin classDatabaseConnection
-
makeConnection
Description copied from class:DatabaseConnectionMake the connection.
This abstract method should be implemented by concrete sub-classes to make or check the current connection to the Jdbc source.
- Specified by:
makeConnectionin classDatabaseConnection- Returns:
- a java.sql.Connection
- Throws:
SQLException- if the connection could not be made.- See Also:
-
getConnectUrl
Returns the connection string to use for this JDBC source.
- Returns:
- the connection string to use for this JDBC source
-
setConnectUrl
Sets the connection string to use for this JDBC source.
- Parameters:
s- the connection string to use for this JDBC source
-
equals
Description copied from class:DatabaseConnectionForce implementations to over-ride equals with a semantic implementation.
- Specified by:
equalsin classDatabaseConnection- See Also:
-
hashCode
public int hashCode()Description copied from class:DatabaseConnectionForce implementations to over-ride hashcode.
- Specified by:
hashCodein classDatabaseConnection- See Also:
-
getConnectionName
Description copied from class:DatabaseConnectionReturns a name for this connection for logging purposes.
- Specified by:
getConnectionNamein classDatabaseConnection- Returns:
- a name for this connection for logging purposes
- See Also:
-