Created
February 15, 2011 20:14
-
-
Save MikaelAmborn/828154 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.SQLException; | |
import javax.sql.DataSource; | |
import org.dbunit.database.DatabaseDataSourceConnection; | |
import org.springframework.jdbc.datasource.DataSourceUtils; | |
public class SpringDatabaseDataSourceConnection extends DatabaseDataSourceConnection { | |
private final DataSource dataSource; | |
public SpringDatabaseDataSourceConnection(DataSource dataSource) throws SQLException { | |
super(dataSource); | |
this.dataSource = dataSource; | |
} | |
public Connection getConnection() throws SQLException { | |
Connection conn = DataSourceUtils.getConnection(dataSource); | |
return new SpringConnection(dataSource, conn); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment