Description
Using SQL, the QueryToMapGen will query data from one or more database table columns into a memory buffer. The query is executed before the first row of test data is generated. The number of rows that may be queried has no limits. Only a subset of the queried rows is kept in memory, at any given time, based on the size of the memory buffer.
This Generator works in concert with the QueryFromMapGen. The QueryFromMapGen maps to a given column that is managed by a QueryToMapGen Generator to generate its data for a given Attribute.
Please Note: This generator will not run if any of the following keywords are found within the SQL query statement:
- update
- delete
- set
- truncate
Generator Parameters
The following parameters may be used to configure the QueryToMapGen Generator. Parameters with an asterisk (*) are required.
- resourcePath* - Defines the path where the resource file for JDBC connection properties exists.
- resourceSubDir - Defines an optional subdirectory under the resourcePath where the resource file for JDBC connection properties exists.
- resourceName* - Defines the name of the resource that contains the database connection information on a user's local machine.
- namespace - Defines a value that will uniquely define the result of the query in the memory allowing for two or more query results to exist in memory at the same time.
- bufferSize* - Defines how many rows to keep in memory at a time. Note: Setting the number of rows to a very high number may cause an OutOfMemoryException to occur if the computer does not have enough available memory. The default buffer size is 1000 rows.
- setLoop* - setLoop provides the ability to OVERRIDE the loopCount, at the Scenario level, and to the number of rows that are queried. The default is set to False.
- queryOnce* - When the Domain that defines the query has a Parent Domain, it becomes a Child Domain of the Parent Domain. This flag determines if the Child Doman's query should be executed each time the Child Domain is called from the Parent Domain or if the query should only be executed once, the first time the Parent Domain calls the Child Domain. The default is set to True to query once.
- grVar1 - The first of five possible variables that may be used within the query.
- grVar2 - The second of five possible variables that may be used within the query.
- grVar3 - The third of five possible variables that may be used within the query.
- grVar4 - The fourth of five possible variables that may be used within the query.
- grVar5 - The fifth of five possible variables that may be used within the query.
- query* - Defines the SQL query statement to execute. A Where clause can also be included in the query statement.
- list - Stores values into a list that is used for previewing data only within the GenRocket web platform.