Package org.quartz.utils
Class JNDIConnectionProvider
- java.lang.Object
-
- org.quartz.utils.JNDIConnectionProvider
-
- All Implemented Interfaces:
ConnectionProvider
public class JNDIConnectionProvider extends java.lang.Object implements ConnectionProvider
A
ConnectionProvider
that provides connections from aDataSource
that is managed by an application server, and made available via JNDI.- Author:
- James House, Sharada Jambula, Mohammad Rezaei, Patrick Lightbody, Srinivas Venkatarangaiah
- See Also:
DBConnectionManager
,ConnectionProvider
,PoolingConnectionProvider
-
-
Constructor Summary
Constructors Constructor Description JNDIConnectionProvider(java.lang.String jndiUrl, boolean alwaysLookup)
ConstructorJNDIConnectionProvider(java.lang.String jndiUrl, java.util.Properties jndiProps, boolean alwaysLookup)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.sql.Connection
getConnection()
protected org.slf4j.Logger
getLog()
void
initialize()
boolean
isAlwaysLookup()
void
setAlwaysLookup(boolean b)
void
shutdown()
-
-
-
Constructor Detail
-
JNDIConnectionProvider
public JNDIConnectionProvider(java.lang.String jndiUrl, boolean alwaysLookup)
Constructor- Parameters:
jndiUrl
- The url for the datasource
-
JNDIConnectionProvider
public JNDIConnectionProvider(java.lang.String jndiUrl, java.util.Properties jndiProps, boolean alwaysLookup)
Constructor- Parameters:
jndiUrl
- The URL for the DataSourcejndiProps
- The JNDI properties to use when establishing the InitialContext for the lookup of the given URL.
-
-
Method Detail
-
getLog
protected org.slf4j.Logger getLog()
-
getConnection
public java.sql.Connection getConnection() throws java.sql.SQLException
- Specified by:
getConnection
in interfaceConnectionProvider
- Returns:
- connection managed by this provider
- Throws:
java.sql.SQLException
-
isAlwaysLookup
public boolean isAlwaysLookup()
-
setAlwaysLookup
public void setAlwaysLookup(boolean b)
-
shutdown
public void shutdown() throws java.sql.SQLException
- Specified by:
shutdown
in interfaceConnectionProvider
- Throws:
java.sql.SQLException
-
initialize
public void initialize() throws java.sql.SQLException
- Specified by:
initialize
in interfaceConnectionProvider
- Throws:
java.sql.SQLException
-
-