Skip to content

Instantly share code, notes, and snippets.

@mroger
Last active October 23, 2015 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mroger/c2c265ffebbb49ffb637 to your computer and use it in GitHub Desktop.
Save mroger/c2c265ffebbb49ffb637 to your computer and use it in GitHub Desktop.
Reference to a new datasource
...
<bean id="dataSourceSpied"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/fitnessTracker?autoReconnect=true" />
<property name="username" value="root" />
<property name="password" value="password" />
</bean>
<bean id="dataSource" class="net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy">
<constructor-arg ref="dataSourceSpied" />
</bean>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment