Klasse SQLValueProvider
java.lang.Object
com.inet.report.SQLValueProvider
- Alle implementierten Schnittstellen:
DynamicValueProvider, NodeParser, Serializable
- Bekannte direkte Unterklassen:
FieldValueProvider, 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
The ResultSet returned should have one column for the value and, if desired, one for the description of each default value.
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.
- Seit:
- 7.0
- Siehe auch:
-
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final intThe maximum number of records that will be fetched before the rest are ignored and the prompt becomes editable. -
Methodenübersicht
Modifikator und TypMethodeBeschreibungabstract DatasourceReturns the data source the query is to be run onReturns an array of DefaultValue objects for a prompt field.voidgetDefaultValues(@Nonnull Function<DefaultValue, Boolean> func) Query the DefaultValue objects for a prompt field.abstract StringgetSQL()Returns the query which is to be used for fetching the values and optionally descriptions dynamically.booleanFOR INTERNAL USE ONLY Internal method for reading report XMLvoidFOR INTERNAL USE ONLY Internal method for reading report XMLvoidparseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) FOR INTERNAL USE ONLY Internal method for reading report XMLvoidFOR INTERNAL USE ONLY Internal method for reading report XMLVon Klasse geerbte Methoden Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden NodeParser
parseElement
-
Felddetails
-
MAX_RECORDS
public static final int MAX_RECORDSThe maximum number of records that will be fetched before the rest are ignored and the prompt becomes editable.- Siehe auch:
-
-
Methodendetails
-
getDefaultValues
Returns an array of DefaultValue objects for a prompt field. Will never return null.- Angegeben von:
getDefaultValuesin SchnittstelleDynamicValueProvider- Gibt zurück:
- an array of DefaultValue objects for a prompt field. Will never return null.
-
getDefaultValues
Query the DefaultValue objects for a prompt field. Its stops if the function return false.- Angegeben von:
getDefaultValuesin SchnittstelleDynamicValueProvider- Parameter:
func- the function to use to compute the value- Löst aus:
IllegalStateException- if the query returns a value or a description longer than 50000 characters.
-
getSQL
Returns the query which is to be used for fetching the values and optionally descriptions dynamically.- Gibt zurück:
- query to be used
- Löst aus:
ReportException- if the database structure does allow a single joined querySQLException- on SQL errors during requesting metadata- Seit:
- 7.0
-
getDatasource
Returns the data source the query is to be run on- Gibt zurück:
- data source to use
- Seit:
- 7.0
-
isDOMParser
public boolean isDOMParser()FOR INTERNAL USE ONLY Internal method for reading report XMLReturns whether this node is to be read via a DOM parser.
- Angegeben von:
isDOMParserin SchnittstelleNodeParser- Gibt zurück:
- true if this node is to be read via a DOM parser, false otherwise.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String, Object> parserMap) throws FatalParserExceptionFOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Angegeben von:
parseEndElementin SchnittstelleNodeParser- Parameter:
group- XMLTag of the current node to be parsed, or null if there is no such current group.tag- The XMLTag to be parsedparserMap- The map of current Parser.- Löst aus:
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.
-
parseText
FOR INTERNAL USE ONLY Internal method for reading report XMLThis method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)
- Angegeben von:
parseTextin SchnittstelleNodeParser- Parameter:
text- text encountered and to be storedparserMap- The map of current Parser.
-
parseDOM
FOR INTERNAL USE ONLY Internal method for reading report XMLParses the node.
- Angegeben von:
parseDOMin SchnittstelleNodeParser- Parameter:
node- the nodeparserMap- The map of current Parser.- Löst aus:
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.
-