public class DataManager
extends org.apache.commons.dbutils.QueryRunner
Modifier and Type | Field and Description |
---|---|
protected LeoArrayListHandler |
handler
Query results handler.
|
Constructor and Description |
---|
DataManager(DatabaseConnectionInformation databaseConnectionInformation)
Constructor with database connection information.
|
DataManager(DataSource dataSource)
Initialize the DataManager with a DataSource object.
|
DataManager(String driver,
String url,
String user,
String pwd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
LeoArrayListHandler |
getHandler()
Return a reference to the LeoArrayListHandler which manages query execution and results.
|
ResultSetMetaData |
getResultSetMetaData()
Return the MetaData from the ResultSet of the query that was last executed.
|
List<Object[]> |
query(String sql)
Execute a SQL query against the database and capture the ResultSet.
|
List<Object[]> |
query(String sql,
Object... params)
Execute a SQL query against the database and capture the ResultSet.
|
batch, batch, insert, insert, insert, insert, insertBatch, insertBatch, query, query, query, query, query, query, query, query, update, update, update, update, update, update
protected LeoArrayListHandler handler
public DataManager(String driver, String url, String user, String pwd) throws ClassNotFoundException, SQLException
driver
- the jdbc driver class.url
- the jdbc connection url.user
- the connection username.pwd
- the connection password.ClassNotFoundException
- thrown if the JDBC driver cannot be found.IllegalAccessException
- thrown if there is an access exception making the JDBC driver connection.InstantiationException
- thrown if the JDBC driver cannot be instantiated.SQLException
- thrown if there is an exception with the query or result set.public DataManager(DatabaseConnectionInformation databaseConnectionInformation) throws ClassNotFoundException, SQLException
databaseConnectionInformation
- the connection information object.ClassNotFoundException
- thrown if the JDBC driver cannot be found.IllegalAccessException
- thrown if there is an access exception making the JDBC driver connection.InstantiationException
- thrown if the JDBC driver cannot be instantiated.SQLException
- thrown if there is an exception with the query or result set.public DataManager(DataSource dataSource)
dataSource
- the data source to use for the query.public List<Object[]> query(String sql) throws SQLException
sql
- the sql to execute.SQLException
- if a SQL error occurs.public List<Object[]> query(String sql, Object... params) throws SQLException
sql
- the sql to execute.params
- the parameters to pass to the sql query.SQLException
- if a SQL error occurs.public ResultSetMetaData getResultSetMetaData()
public LeoArrayListHandler getHandler()
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.