com.ebay.carad.os.vitalsigns.dao
Class SqlDAO
java.lang.Object
com.ebay.carad.os.vitalsigns.dao.SqlDAO
- All Implemented Interfaces:
- ISqlDAO
public class SqlDAO
- extends java.lang.Object
- implements ISqlDAO
Straight-forward implementation of ISqlDAO that utilizes commons-dbutils.
- Version:
- $Id$
- Author:
- Jeremy Thomerson
Field Summary |
private static org.apache.log4j.Logger |
LOGGER
|
private org.apache.commons.dbutils.handlers.MapListHandler |
mMapListHandler
|
private org.apache.commons.dbutils.QueryRunner |
mQueryRunner
|
Method Summary |
java.util.List |
findBySqlQuery(java.lang.String query)
Executes an arbitrary SQL select statement against the configured connection,
and returns the result as a List of Maps (via Commons DbUtils). |
void |
setDataSource(javax.sql.DataSource dataSource)
|
int |
updateWithSQL(java.lang.String query)
Executes an arbitrary SQL UPDATE or INSERT statement against the configured connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
private static final org.apache.log4j.Logger LOGGER
mQueryRunner
private org.apache.commons.dbutils.QueryRunner mQueryRunner
mMapListHandler
private org.apache.commons.dbutils.handlers.MapListHandler mMapListHandler
SqlDAO
public SqlDAO()
findBySqlQuery
public java.util.List findBySqlQuery(java.lang.String query)
- Description copied from interface:
ISqlDAO
- Executes an arbitrary SQL select statement against the configured connection,
and returns the result as a List of Maps (via Commons DbUtils).
- Specified by:
findBySqlQuery
in interface ISqlDAO
- Parameters:
query
- the SQL query to run
- Returns:
- a list of maps
updateWithSQL
public int updateWithSQL(java.lang.String query)
- Description copied from interface:
ISqlDAO
- Executes an arbitrary SQL UPDATE or INSERT statement against the configured connection.
- Specified by:
updateWithSQL
in interface ISqlDAO
- Parameters:
query
- the SQL query to run
- Returns:
- the number of affected rows
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
Copyright © 2004-2009. All Rights Reserved.