|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enableit.db.DatabaseProxy
Proxy class to wrap database access in a simple form. The user is required to
provide their own Connection
Field Summary | |
static java.lang.String |
about
CVS info about this class and its current version |
protected static org.apache.log4j.Category |
cat
The Log4J Category doing the logging. |
static int |
LIST
Valid Object type for result set returns |
static int |
SQL_RESULT_SET
Valid Object type for result set returns. |
Constructor Summary | |
DatabaseProxy()
|
Method Summary | |
static int |
executeDmlProcedure(java.sql.Connection conn,
java.lang.String sp,
java.util.List parms)
Execute the supplied stored procedure against the supplied database connection. |
static java.util.ArrayList |
executeQuery(java.sql.Connection conn,
java.lang.String sql)
Execute the supplied SQL query against the supplied database connection. |
static java.lang.Object |
executeQuery(java.sql.Connection conn,
java.lang.String sql,
int returnType)
Deprecated. use executeQuery(conn:Connection, sql:String):java.util.ArrayList instead |
static java.lang.Object |
executeQueryProcedure(java.sql.Connection conn,
java.lang.String sp,
java.util.List parms,
int returnType)
Execute the supplied stored procedure against the supplied database connection. |
static int |
executeUpdate(java.sql.Connection conn,
java.lang.String sql)
Execute the supplied SQL update query against a the supplied database connection. |
static int |
executeUpdate(java.sql.Connection conn,
java.lang.String sql,
java.util.List parms)
Execute the supplied SQL update query against a the supplied database connection. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int LIST
public static final int SQL_RESULT_SET
java.sql.ResultSet
the developer
must take care to ensure that the reference and the Connection
that created it are correctly closed to avoid a memory leak.protected static org.apache.log4j.Category cat
Category
doing the logging.
Same Category
is used throughout the library.public static final java.lang.String about
Constructor Detail |
public DatabaseProxy()
Method Detail |
public static java.util.ArrayList executeQuery(java.sql.Connection conn, java.lang.String sql) throws DBException
conn
- The database connection to usesql
- The SQL query to executejava.util.ArrayList
, each
element of which is a java.util.TreeMap
holding a
single row of resultsDBException
- If execution of the query failed.public static java.lang.Object executeQuery(java.sql.Connection conn, java.lang.String sql, int returnType) throws DBException
executeQuery(conn:Connection, sql:String):java.util.ArrayList
instead
conn
- The database connection to usesql
- The SQL query to executereturnType
- The object type to convert the SQL results intoDBException
- If execution of the query failed.public static int executeUpdate(java.sql.Connection conn, java.lang.String sql) throws DBException
sql
- The SQL update to executeconn
- The database connection to useDBException
- If execution of the update failed.public static int executeUpdate(java.sql.Connection conn, java.lang.String sql, java.util.List parms) throws java.sql.SQLException, DBException
conn
- The database connection to usesql
- The SQL update to execute with parameters represented by ?parms
- ArrayList
containing parameters to insert in the sql statementDBException
- If execution of the update failed.public static int executeDmlProcedure(java.sql.Connection conn, java.lang.String sp, java.util.List parms) throws DBException
conn
- The database connection to usesp
- A string containing the stored procedure nameparms
- A java.util.List
of String parameters for the stored procedureDBException
- If execution of the stored procedure failed.public static java.lang.Object executeQueryProcedure(java.sql.Connection conn, java.lang.String sp, java.util.List parms, int returnType) throws DBException
conn
- The database connection to usesp
- A string containing the stored procedure nameparms
- A java.util.List
of String parameters for the stored procedurereturnType
- One of the defined return types defined as constants within this class.java.lang.Object
containing any rows found.
The Object
type is defined by the return type parameterDBException
- If execution of the stored procedure failed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |