org.enableit.db
Class GenericDBProxy
java.lang.Object
|
+--org.enableit.db.DatabaseProxy
|
+--org.enableit.db.GenericDBProxy
- public class GenericDBProxy
- extends DatabaseProxy
Proxy class to wrap any java application database access in a simple form
- Version:
- v1.0
- Author:
- chris.pettifer@enableit.org
Field Summary |
static java.lang.String |
about
Information on the exact CVS version accessible after compilation |
protected static org.apache.log4j.Category |
cat
The Log4J Category doing the logging. |
Method Summary |
static int |
executeDmlProcedure(java.lang.String sp,
java.util.ArrayList parms)
Execute the supplied stored procedure against a database connection
supplied from ConnectionFactory . |
static java.lang.Object |
executeQuery(java.lang.String sql,
int returnType)
Execute the supplied SQL query against a database connection
supplied from ConnectionFactory . |
static java.lang.Object |
executeQueryProcedure(java.lang.String sp,
java.util.List parms,
int returnType)
Execute the supplied stored procedure against a database connection
supplied from ConnectionFactory . |
static int |
executeUpdate(java.lang.String sql)
Execute the supplied SQL update query against a database connection
supplied from ConnectionFactory . |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
cat
protected static org.apache.log4j.Category cat
- The Log4J
Category
doing the logging.
Same Category
is used throughout the package.
about
public static final java.lang.String about
- Information on the exact CVS version accessible after compilation
GenericDBProxy
public GenericDBProxy()
executeUpdate
public static int executeUpdate(java.lang.String sql)
throws DBException
- Execute the supplied SQL update query against a database connection
supplied from
ConnectionFactory
.
- Parameters:
sql
- The SQL update to execute- Returns:
- int
The number of rows affected by the update.
- Throws:
DBException
- If execution of the update failed.
executeQuery
public static java.lang.Object executeQuery(java.lang.String sql,
int returnType)
throws DBException
- Execute the supplied SQL query against a database connection
supplied from
ConnectionFactory
.
- Parameters:
sql
- The SQL query to executereturnType
- int defining the return object types, enumerated on DatabaseProxy- Returns:
- Object
The SQL results as the object type requested
- Throws:
DBException
- If execution of the query failed.
executeDmlProcedure
public static int executeDmlProcedure(java.lang.String sp,
java.util.ArrayList parms)
throws DBException
- Execute the supplied stored procedure against a database connection
supplied from
ConnectionFactory
.
- Parameters:
sp
- A string containing the stored procedure nameparms
- ArrayList
holding parameters required for stored proc- Returns:
- int
The number of rows affected by the stored procedure executed
- Throws:
DBException
- If execution of the query failed
executeQueryProcedure
public static java.lang.Object executeQueryProcedure(java.lang.String sp,
java.util.List parms,
int returnType)
throws DBException
- Execute the supplied stored procedure against a database connection
supplied from
ConnectionFactory
.
- Parameters:
sp
- A string containing the stored procedure nameparms
- ArrayList
holding parameters required for stored procreturnType
- int defining the return object types, enumerated on DatabaseProxy- Returns:
- object
java.lang.Object
containing any rows found
Object type matches the enumeration in DatabaseProxy
- Throws:
DBException
- If execution of the update failed.
Copyright © enableIT.org 1999,2000,2001,2002 All Rights Reserved.