org.apache.cayenne.conf
Class JNDIDataSourceFactory
java.lang.Object
org.apache.cayenne.conf.JNDIDataSourceFactory
- All Implemented Interfaces:
- DataSourceFactory
public class JNDIDataSourceFactory
- extends java.lang.Object
- implements DataSourceFactory
Looks up DataSource objects via JNDI.
- Author:
- Andrei Adamchik
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parentConfig
protected Configuration parentConfig
JNDIDataSourceFactory
public JNDIDataSourceFactory()
initializeWithParentConfiguration
public void initializeWithParentConfiguration(Configuration conf)
- Description copied from interface:
DataSourceFactory
- Initializes factory with the parent configuration object.
- Specified by:
initializeWithParentConfiguration
in interface DataSourceFactory
getDataSource
public javax.sql.DataSource getDataSource(java.lang.String location,
org.apache.log4j.Level logLevel)
throws java.lang.Exception
- Deprecated. since 1.2
- Returns DataSource object corresponding to
location
. Location is
expected to be a path mapped in JNDI InitialContext.
- Specified by:
getDataSource
in interface DataSourceFactory
- Throws:
java.lang.Exception
getDataSource
public javax.sql.DataSource getDataSource(java.lang.String location)
throws java.lang.Exception
- Attempts to load DataSource using JNDI. In case of failure tries to get the
DataSource with the same name from CayenneModeler preferences.
- Specified by:
getDataSource
in interface DataSourceFactory
- Throws:
java.lang.Exception
Copyright © 2001-2006 Apache.org All Rights Reserved.