|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.SQLValueProvider
com.inet.report.QueryValueProvider
public class QueryValueProvider
This implementation of DynamicValueProvider takes a given SQL statement and executes it as a
query on the given data source. This is done via Connection.createStatement() and
Statement.executeQuery(String), which means that the SQL query can be any standard
SQL statement. SPs also work for most databases, but not for Oracle or PostgreSQL.
The ResultSet returned should have the data of the first column be for the value and,
if desired, have a second column with data for the description of each default value. Optionally instead, there should be a
column called 'value' and a column called 'description'.
Datasource,
Statement.execute(String),
Serialized Form| Field Summary |
|---|
| Fields inherited from class com.inet.report.SQLValueProvider |
|---|
MAX_RECORDS |
| Constructor Summary | |
|---|---|
QueryValueProvider(java.lang.String query,
Datasource datasource)
Creates an instance of QueryValueProvider with the given query and data source. |
|
| Method Summary | |
|---|---|
Datasource |
getDatasource()
Returns the data source the query is to be run on |
java.lang.String |
getFieldRefName()
Returns the name to be used as the SQL reference name in the WHERE part of the query used by a cascading prompt referencing this as its parent. |
java.lang.String |
getSQL()
Returns the query which is to be used for fetching the values and optionally descriptions dynamically. |
NodeParser |
parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
Internal method for reading report XML Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. |
void |
setDatasource(Datasource datasource)
Sets the data source on which the query is to be executed. |
void |
setFieldRefName(java.lang.String refName)
Sets the reference name to use if this provider used as a parent source to a cascading prompt. |
void |
setSQL(java.lang.String query)
Query to execute. |
| Methods inherited from class com.inet.report.SQLValueProvider |
|---|
getDefaultValues |
| Methods inherited from interface com.inet.report.parser.NodeParser |
|---|
isDOMParser, parseDOM, parseEndElement, parseText |
| Constructor Detail |
|---|
public QueryValueProvider(java.lang.String query,
Datasource datasource)
query - Query to use to extract default values from, may not be null. Its ResultSet
should have its first column be the value of each default value and an optional second
column will be used as the description of each default value. Optionally instead, there should be a
column called 'value' and a column called 'description'.datasource - data source to run the query on, may not be null
java.lang.IllegalArgumentException - if the query or the data source is nullDatasource,
DynamicValueProvider| Method Detail |
|---|
public void setDatasource(Datasource datasource)
datasource - data source to execute the query on.
java.lang.IllegalArgumentException - if datasource is nullpublic Datasource getDatasource()
getDatasource in class SQLValueProviderpublic void setSQL(java.lang.String query)
query - Query to execute. Its ResultSet should have its first column be the value of each
default value and an optional second column will be used as the description of each
default value.
java.lang.IllegalArgumentException - if query is nullpublic java.lang.String getSQL()
getSQL in class SQLValueProviderpublic java.lang.String getFieldRefName()
reference name = prompt value)".
getFieldRefName in interface CascadingSourceCascadingValueProvider,
SQLValueProviderpublic void setFieldRefName(java.lang.String refName)
refName - Reference name to use in the SQL query to filter cascading results if this provider
is referenced as a parent to a cascading prompt.
public NodeParser parseElement(com.inet.report.parser.XMLTag group,
java.lang.String tag,
org.xml.sax.Attributes atts,
java.util.Map parserMap)
throws FatalParserException
Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
parseElement in interface NodeParsergroup - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group
of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag - The XMLTag to be parsedatts - The set of attributes in the current XMLTagparserMap - The map of current Parser.
FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the
reading of the report.
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||