org.apache.commons.jelly.tags.sql
Class DataSourceUtil
java.lang.Object
org.apache.commons.jelly.tags.sql.DataSourceUtil
- public class DataSourceUtil
- extends java.lang.Object
A simple DataSource
utility for the standard
DriverManager
class.
TO DO: need to cache DataSource
- Author:
- Justyna Horwat
Field Summary |
private static java.lang.String |
ESCAPE
|
private static org.apache.commons.logging.Log |
log
The Log to which logging calls will be made. |
private static java.lang.String |
TOKEN
|
Method Summary |
(package private) static javax.sql.DataSource |
getDataSource(java.lang.Object rawDataSource,
org.apache.commons.jelly.JellyContext pc)
If dataSource is a String first do JNDI lookup. |
private static javax.sql.DataSource |
getDataSource(java.lang.String params)
Parse JDBC parameters and setup dataSource appropriately |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ESCAPE
private static final java.lang.String ESCAPE
- See Also:
- Constant Field Values
TOKEN
private static final java.lang.String TOKEN
- See Also:
- Constant Field Values
log
private static final org.apache.commons.logging.Log log
- The Log to which logging calls will be made.
DataSourceUtil
public DataSourceUtil()
getDataSource
static javax.sql.DataSource getDataSource(java.lang.Object rawDataSource,
org.apache.commons.jelly.JellyContext pc)
throws org.apache.commons.jelly.JellyTagException
- If dataSource is a String first do JNDI lookup.
If lookup fails parse String like it was a set of JDBC parameters
Otherwise check to see if dataSource is a DataSource object and use as
is
- Throws:
org.apache.commons.jelly.JellyTagException
getDataSource
private static javax.sql.DataSource getDataSource(java.lang.String params)
throws org.apache.commons.jelly.JellyTagException
- Parse JDBC parameters and setup dataSource appropriately
- Throws:
org.apache.commons.jelly.JellyTagException