public class JdbcQueryHelper extends java.lang.Object implements IDataSourceQueryHelper
Constructor and Description |
---|
JdbcQueryHelper(java.sql.Connection conn,
org.apache.log4j.Logger log,
int timeout,
int resultSetType,
JdbcDataSource dsp) |
Modifier and Type | Method and Description |
---|---|
void |
addSelectListener(JdbcSelectListener listener)
Adds a select Listener which is notified whenever a select has been executed.
|
void |
closeConnection()
Close the connection.
|
java.lang.String |
fixQuery(java.lang.String query,
IDataSourceResultRow resultRow) |
java.sql.Connection |
getConn() |
IDataSourceResultSet |
getQueryResults(java.lang.String query,
java.lang.String tagType)
Given a select statement.
|
java.lang.String |
getValueFromKey(java.lang.Object o) |
boolean |
isValidQuery(java.lang.String query) |
boolean |
isValidSet(java.lang.Object value) |
java.lang.Object |
resultSetToString(java.lang.String query) |
java.util.Iterator |
selectNodes(IDataSourceResultSet resultSet) |
java.lang.String |
substituteVariables(java.lang.String[] queryParts,
java.lang.Object[] toInsert,
java.lang.String query,
java.util.List<VarResults> parameters)
we do this a little different for jdbc we just throw question marks into the query and let the sql statement class
make the substitutions.
|
java.lang.String |
valueToString(java.lang.Object object)
Called by AbstractDataSource to return string value of obj returned from getValue(tag, stack) method.
|
public JdbcQueryHelper(java.sql.Connection conn, org.apache.log4j.Logger log, int timeout, int resultSetType, JdbcDataSource dsp)
public java.sql.Connection getConn()
public void closeConnection()
public IDataSourceResultSet getQueryResults(java.lang.String query, java.lang.String tagType) throws DataSourceException
IDataSourceQueryHelper
getQueryResults
in interface IDataSourceQueryHelper
DataSourceException
public java.lang.String substituteVariables(java.lang.String[] queryParts, java.lang.Object[] toInsert, java.lang.String query, java.util.List<VarResults> parameters)
substituteVariables
in interface IDataSourceQueryHelper
queryParts
- - The query string broken up into parts such that between each element, an element
of toInsert is inserted (possibly with formatting).toInsert
- - The array of items to insert. toInsert.length is equal to (queryParts.length - 2)query
- parameters
- public java.lang.String valueToString(java.lang.Object object) throws DataSourceException
IDataSourceQueryHelper
valueToString
in interface IDataSourceQueryHelper
object
- returned from getValue() call in AbstractDataSourceDataSourceException
public void addSelectListener(JdbcSelectListener listener)
public java.util.Iterator selectNodes(IDataSourceResultSet resultSet)
selectNodes
in interface IDataSourceQueryHelper
public boolean isValidSet(java.lang.Object value)
isValidSet
in interface IDataSourceQueryHelper
public java.lang.String getValueFromKey(java.lang.Object o)
getValueFromKey
in interface IDataSourceQueryHelper
public boolean isValidQuery(java.lang.String query)
isValidQuery
in interface IDataSourceQueryHelper
public java.lang.String fixQuery(java.lang.String query, IDataSourceResultRow resultRow)
fixQuery
in interface IDataSourceQueryHelper
public java.lang.Object resultSetToString(java.lang.String query)
resultSetToString
in interface IDataSourceQueryHelper
Copyright © 2017 Windward Reports - All Rights Reserved. We are java reporting software