org.springframework.orm.hibernate
Class LocalDataSourceConnectionProvider
java.lang.Object
  
org.springframework.orm.hibernate.LocalDataSourceConnectionProvider
- All Implemented Interfaces: 
 - net.sf.hibernate.connection.ConnectionProvider
 
- Direct Known Subclasses: 
 - TransactionAwareDataSourceConnectionProvider
 
public class LocalDataSourceConnectionProvider
- extends Object
- implements net.sf.hibernate.connection.ConnectionProvider
  
Hibernate connection provider for local DataSource instances
 in an application context. This provider will be used if
 LocalSessionFactoryBean's "dataSource" property is set.
- Since:
 
  - 11.07.2003
 
- Author:
 
  - Juergen Hoeller
 
- See Also:
 LocalSessionFactoryBean.setDataSource(javax.sql.DataSource)
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
LocalDataSourceConnectionProvider
public LocalDataSourceConnectionProvider()
configure
public void configure(Properties props)
               throws net.sf.hibernate.HibernateException
- Specified by:
 configure in interface net.sf.hibernate.connection.ConnectionProvider
 
- Throws:
 net.sf.hibernate.HibernateException
 
getDataSourceToUse
protected DataSource getDataSourceToUse(DataSource originalDataSource)
- Return the DataSource to use for retrieving Connections.
 
This implementation returns the passed-in DataSource as-is.
 
- Parameters:
 originalDataSource - the DataSource as configured by the user
 on LocalSessionFactoryBean
- Returns:
 - the DataSource to actually retrieve Connections from
 (potentially wrapped)
 - See Also:
 LocalSessionFactoryBean.setDataSource(javax.sql.DataSource)
 
 
getDataSource
public DataSource getDataSource()
- Return the DataSource that this ConnectionProvider wraps.
 
 
 
getConnection
public Connection getConnection()
                         throws SQLException
- Specified by:
 getConnection in interface net.sf.hibernate.connection.ConnectionProvider
 
- Throws:
 SQLException
 
closeConnection
public void closeConnection(Connection con)
                     throws SQLException
- Specified by:
 closeConnection in interface net.sf.hibernate.connection.ConnectionProvider
 
- Throws:
 SQLException
 
close
public void close()
- Specified by:
 close in interface net.sf.hibernate.connection.ConnectionProvider
 
 
Copyright (c) 2002-2007 The Spring Framework Project.