|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enableit.db.DataSourceProxy
Proxy class to wrap database access in a simple form.
The user provides just the name of the JDBC2 datasource to use in
obtaining a connection
from the JNDI context.
DatabaseProxy
Field Summary | |
static java.lang.String |
ABOUT
CVS info about this class and its current version |
protected static org.apache.log4j.Category |
logger
The Log4J Category doing the logging. |
Constructor Summary | |
DataSourceProxy()
|
Method Summary | |
static int |
executeDmlProcedure(java.lang.String dataSourceName,
java.lang.String sp,
java.util.List parms)
Execute the supplied update procedure against a connection obtained from the named DataSource. |
static java.util.List |
executeQuery(java.lang.String dataSourceName,
java.lang.String sql)
Execute the supplied SQL query against a connection obtained from the named DataSource. |
static java.util.List |
executeQuery(java.lang.String dataSourceName,
java.lang.String sql,
java.util.List params)
Execute the supplied SQL query against the supplied database connection. |
static java.util.List |
executeQueryProcedure(java.lang.String dataSourceName,
java.lang.String sp,
java.util.List parms)
Execute the supplied query procedure against a connection obtained from the named DataSource. |
static int |
executeUpdate(java.lang.String dataSourceName,
java.lang.String sql)
Execute the supplied SQL update against a the supplied database connection. |
static int |
executeUpdate(java.lang.String dataSourceName,
java.lang.String sql,
java.util.List parms)
Execute the supplied SQL update against a connection obtained from the named DataSource. |
static java.sql.Connection |
getConnection(java.lang.String dataSourceName)
Deprecated. Use ConnectionFactory.getConnection(Provider) instead. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.log4j.Category logger
Category
doing the logging.
Same Category
is used throughout the library.
public static final java.lang.String ABOUT
Constructor Detail |
public DataSourceProxy()
Method Detail |
public static java.sql.Connection getConnection(java.lang.String dataSourceName) throws DBException
Connection
properly.
dataSourceName
- The DataSource to lookup to obtain a connection
DBException
public static java.util.List executeQuery(java.lang.String dataSourceName, java.lang.String sql) throws DBException
dataSourceName
- The datasource name to lookup in order to get a connectionsql
- The SQL query to execute
java.util.ArrayList
, each
element of which is a java.util.TreeMap
holding a
single row of results
DBException
- If execution of the query failed.public static java.util.List executeQuery(java.lang.String dataSourceName, java.lang.String sql, java.util.List params) throws DBException
dataSourceName
- The datasource name to lookup in order to get a connectionsql
- The SQL query to executeparams
- List
containing parameters to insert in the sql statement.
java.util.ArrayList
, each
element of which is a java.util.TreeMap
holding a
single row of results
DBException
- If execution of the query failed.public static int executeUpdate(java.lang.String dataSourceName, java.lang.String sql) throws DBException
sql
- The SQL update to executedataSourceName
- The datasource name to lookup in order to get a connection
DBException
- If execution of the update failed.public static int executeUpdate(java.lang.String dataSourceName, java.lang.String sql, java.util.List parms) throws DBException
dataSourceName
- The datasource name to lookup in order to get a connectionsql
- The SQL update to execute with parameters represented by ?parms
- ArrayList
containing parameters to insert in the sql statement
DBException
- If execution of the update failed.public static int executeDmlProcedure(java.lang.String dataSourceName, java.lang.String sp, java.util.List parms) throws DBException
dataSourceName
- The datasource name to lookup in order to get a connectionsp
- A string containing the stored procedure nameparms
- A java.util.List
of String parameters for the stored procedure
DBException
- If execution of the stored procedure failed.public static java.util.List executeQueryProcedure(java.lang.String dataSourceName, java.lang.String sp, java.util.List parms) throws DBException
dataSourceName
- The datasource name to lookup in order to get a connectionsp
- A string containing the stored procedure nameparms
- A java.util.List
of String parameters for the stored
procedure
java.util.ArrayList
, each
element of which is a java.util.TreeMap
holding a
single row of results
DBException
- If execution of the stored procedure failed.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |