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:
__AUTHOR__

Field Summary
static java.lang.String ABOUT
          Information on the exact CVS version accessible after compilation
protected static org.apache.log4j.Logger logger
          The Log4J Logger doing the logging.
 
Fields inherited from class org.enableit.db.DatabaseProxy
LIST, SQL_RESULT_SET
 
Constructor Summary
GenericDBProxy()
           
 
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.util.List executeQuery(org.enableit.db.beans.Provider prov, java.lang.String sql)
          Execute the supplied SQL query against a database connection supplied from ConnectionFactory.
static java.util.List executeQuery(org.enableit.db.beans.Provider prov, java.lang.String sql, java.util.List parms)
          Execute the supplied SQL query against a database connection supplied from ConnectionFactory.
static java.lang.Object executeQuery(java.lang.String sql, int returnType)
          Deprecated. Use one of the other methods that does not referende return type
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(org.enableit.db.beans.Provider provider, java.lang.String sql)
          Execute the supplied SQL update query against a database connection supplied from ConnectionFactory.
static int executeUpdate(org.enableit.db.beans.Provider provider, java.lang.String sql, java.util.List parms)
          Execute the supplied SQL update query 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.
static int executeUpdate(java.lang.String sql, java.util.List parms)
          Execute the supplied SQL update query against a database connection supplied from ConnectionFactory.
 
Methods inherited from class org.enableit.db.DatabaseProxy
executeDmlProcedure, executeQuery, executeQuery, executeQuery, executeQueryProcedure, executeUpdate, executeUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
The Log4J Logger doing the logging. Same Logger is used throughout the package.


ABOUT

public static final java.lang.String ABOUT
Information on the exact CVS version accessible after compilation

See Also:
Constant Field Values
Constructor Detail

GenericDBProxy

public GenericDBProxy()
Method Detail

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.

executeUpdate

public static int executeUpdate(org.enableit.db.beans.Provider provider,
                                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.

executeUpdate

public static int executeUpdate(java.lang.String sql,
                                java.util.List parms)
                         throws java.sql.SQLException,
                                DBException
Execute the supplied SQL update query against a database connection supplied from ConnectionFactory.

Parameters:
sql - The SQL update to execute with parameters represented by ?
parms - ArrayList containing parameters to insert in the sql statement
Returns:
The number of rows affected by the update.
Throws:
DBException - If execution of the update failed.
java.sql.SQLException

executeUpdate

public static int executeUpdate(org.enableit.db.beans.Provider provider,
                                java.lang.String sql,
                                java.util.List parms)
                         throws java.sql.SQLException,
                                DBException
Execute the supplied SQL update query against a database connection supplied from ConnectionFactory.

Parameters:
sql - The SQL update to execute with parameters represented by ?
parms - ArrayList containing parameters to insert in the sql statement
Returns:
The number of rows affected by the update.
Throws:
DBException - If execution of the update failed.
java.sql.SQLException

executeQuery

public static java.lang.Object executeQuery(java.lang.String sql,
                                            int returnType)
                                     throws DBException
Deprecated. Use one of the other methods that does not referende return type

Execute the supplied SQL query against a database connection supplied from ConnectionFactory.

Parameters:
sql - The SQL query to execute
returnType - 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.

executeQuery

public static java.util.List executeQuery(org.enableit.db.beans.Provider prov,
                                          java.lang.String sql)
                                   throws DBException
Execute the supplied SQL query against a database connection supplied from ConnectionFactory.

Parameters:
sql - The SQL query to execute
Returns:
List The SQL results where each element of the list represents a row. Each row is held in a Map of column name = column value pairs.
Throws:
DBException - If execution of the query failed.

executeQuery

public static java.util.List executeQuery(org.enableit.db.beans.Provider prov,
                                          java.lang.String sql,
                                          java.util.List parms)
                                   throws DBException
Execute the supplied SQL query against a database connection supplied from ConnectionFactory.

Parameters:
sql - The SQL query to execute
Returns:
List The SQL results where each element of the list represents a row. Each row is held in a Map of column name = column value pairs.
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 name
parms - 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 name
parms - ArrayList holding parameters required for stored proc
returnType - 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 © 1999-2004 enableIT.org. All Rights Reserved.