i-net Clear Reports

com.inet.report
Class SQLValueProvider

java.lang.Object
  extended by com.inet.report.SQLValueProvider
All Implemented Interfaces:
DynamicValueProvider, NodeParser, java.io.Serializable
Direct Known Subclasses:
FieldValueProvider, QueryValueProvider

public abstract class SQLValueProvider
extends java.lang.Object
implements DynamicValueProvider

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 one column for the value and, if desired, one for the description of each default value.

See Also:
Datasource, Statement.execute(String), Serialized Form

Field Summary
static int MAX_RECORDS
          The maximum number of records that will be fetched before the rest are ignored and the prompt becomes editable.
 
Method Summary
abstract  Datasource getDatasource()
          Returns the data source the query is to be run on
 DefaultValue[] getDefaultValues()
          Returns an array of DefaultValue objects for a prompt field.
abstract  java.lang.String getSQL()
          Returns the query which is to be used for fetching the values and optionally descriptions dynamically.
 
Methods inherited from interface com.inet.report.parser.NodeParser
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
 

Field Detail

MAX_RECORDS

public static final int MAX_RECORDS
The maximum number of records that will be fetched before the rest are ignored and the prompt becomes editable.

See Also:
Constant Field Values
Method Detail

getDefaultValues

public DefaultValue[] getDefaultValues()
Returns an array of DefaultValue objects for a prompt field. Will never return null.

Specified by:
getDefaultValues in interface DynamicValueProvider
Returns:
an array of DefaultValue objects for a prompt field. Will never return null.
Throws:
java.lang.IllegalStateException - if the query returns a value or a description longer than 50000 characters.

getSQL

public abstract java.lang.String getSQL()
Returns the query which is to be used for fetching the values and optionally descriptions dynamically.

Returns:
query to be used

getDatasource

public abstract Datasource getDatasource()
Returns the data source the query is to be run on

Returns:
data source to use

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH