public class UnitilsDataSourceFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean
FactoryBean that provides access to the datasource configured in unitils.
For example, you can define a bean in spring named 'dataSource' that connects to the test database as follows:
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
| Constructor and Description |
|---|
UnitilsDataSourceFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getObject()
Gets the data source instance.
|
Object |
getObject(String databaseName)
Gets the data source instance.
|
Class<?> |
getObjectType()
Gets the type of the object provided by this
FactoryBean, i.e. |
boolean |
isSingleton() |
public Object getObject(String databaseName) throws Exception
Exceptionpublic Object getObject() throws Exception
getObject in interface org.springframework.beans.factory.FactoryBeanExceptionpublic Class<?> getObjectType()
FactoryBean, i.e. DataSourcegetObjectType in interface org.springframework.beans.factory.FactoryBeanpublic boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBeanCopyright © 2017. All rights reserved.