org.apache.jetspeed.components.datasource
Class SchemaAwareDataSourceProxy
java.lang.Object
org.springframework.jdbc.datasource.DelegatingDataSource
org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
org.apache.jetspeed.components.datasource.SchemaAwareDataSourceProxy
- All Implemented Interfaces:
- DataSource, org.springframework.beans.factory.InitializingBean
public class SchemaAwareDataSourceProxy
- extends org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
The SchemaAwareDataSourceProxy optionally injects a schema selection into an
existing database connection. It proxies a DataSource and executes an
injected sql statement on every getConnection() call.
Inspired by http://forum.springframework.org/showthread.php?t=10728, runtime
schema switching was stripped.
- Version:
- $Id: SchemaAwareDataSourceProxy.java 601297 2007-12-05 11:20:04Z ate $
- Author:
- Joachim Müller
Methods inherited from class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy |
getTransactionAwareConnectionProxy |
Methods inherited from class org.springframework.jdbc.datasource.DelegatingDataSource |
afterPropertiesSet, getConnection, getLoginTimeout, getLogWriter, getTargetDataSource, setLoginTimeout, setLogWriter, setTargetDataSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static final org.apache.commons.logging.Log log
schemaSql
private String schemaSql
SchemaAwareDataSourceProxy
public SchemaAwareDataSourceProxy()
setSchemaSql
public void setSchemaSql(String schemaSql)
getConnection
public Connection getConnection()
throws SQLException
- Specified by:
getConnection
in interface DataSource
- Overrides:
getConnection
in class org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy
- Throws:
SQLException
Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.