com.mtgi.analytics.sql
Class BehaviorTrackingDataSource
java.lang.Object
org.springframework.jdbc.datasource.DelegatingDataSource
com.mtgi.analytics.sql.BehaviorTrackingDataSource
- All Implemented Interfaces:
- Wrapper, CommonDataSource, DataSource, org.springframework.beans.factory.InitializingBean
public class BehaviorTrackingDataSource
- extends org.springframework.jdbc.datasource.DelegatingDataSource
A datasource which adds SQL event logging to the behavior tracking database. Events are persisted
to the required BehaviorTrackingManager
. Events
are of type "jdbc" unless overridden with a call to setEventType(String)
. Event names are the
Statement API call that executed the SQL (e.g. "execute", "executeQuery", "executeUpdate"), with event
data containing the exact SQL and parameter values logged.
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource |
afterPropertiesSet, getLoginTimeout, getLogWriter, getTargetDataSource, setLoginTimeout, setLogWriter, setTargetDataSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BehaviorTrackingDataSource
public BehaviorTrackingDataSource()
setEventType
public void setEventType(String eventType)
setTrackingManager
public void setTrackingManager(BehaviorTrackingManager trackingManager)
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection
in interface DataSource
- Overrides:
getConnection
in class org.springframework.jdbc.datasource.DelegatingDataSource
- Throws:
SQLException
getConnection
public Connection getConnection(String username,
String password)
throws SQLException
- Specified by:
getConnection
in interface DataSource
- Overrides:
getConnection
in class org.springframework.jdbc.datasource.DelegatingDataSource
- Throws:
SQLException