Product Selector

Fusion 5.9
    Fusion 5.9

    JDBC Index Stage

    Table of Contents

    The JDBC Index Stage is used to connect to a database, lookup one or more values, and then inject them into the context. The properties for setting stage are identical to the JDBC Query Stage, except for the "rows" property, which defaults to -1 for the index stage (which returns all rows in the database), and defaults to 10 returned rows for the query stage.

    Example

    An example of a JDBC Index Stage setup

    Upload stage config via POST to Fusion REST API endpoint `api/index-stages/instances`

    curl -u USERNAME:PASSWORD -X POST -H "Content-Type: application/json" -d '{"id": "jdbc-index-test","type":"jdbc-index-lookup","driver":"postgresql-9.3-1101-jdbc4.jar","connection":"jdbc:postgresql:database","username":"user","password":"password1","preparedStatement":"select ID as id from DATABASE;"}' http://localhost:8764/api/index-stages/instances

    Response

    {
      "type" : "jdbc-index-lookup",
      "id" : "jdbc-index-test",
      "driver" : "postgresql-9.3-1101-jdbc4.jar",
      "connection" : "jdbc:postgresql:database",
      "username" : "user",
      "password" : "password1",
      "preparedStatement" : "select ID as id from DATABASE;",
      "fetchSize" : -1,
      "join" : true,
      "rows" : -1,
      "skip" : false,
      "label" : "jdbc-index-lookup",
      "type" : "jdbc-index-lookup"
    }

    Configuration

    When entering configuration values in the UI, use unescaped characters, such as \t for the tab character. When entering configuration values in the API, use escaped characters, such as \\t for the tab character.

    Connect to a database and lookup one or more values and inject them into the context

    skip - boolean

    Set to true to skip this stage.

    Default: false

    label - string

    A unique label for this stage.

    <= 255 characters

    condition - string

    Define a conditional script that must result in true or false. This can be used to determine if the stage should process or not.

    driver - stringrequired

    The fully qualified class name of the JDBC Driver to use.

    connection - stringrequired

    The connection string for the database.

    username - stringrequired

    The username to connect to the database.

    password - stringrequired

    The password to connect to the database.

    preparedStatement - stringrequired

    The SQL Prepared Statement to execute when bound with values.

    rows - integer

    The number of rows to return. -1 for all rows (be wary of memory usage for this).

    Default: -1

    fetchSize - integer

    The JDBC Fetch Size to use. If -1, use the driver default.

    Default: -1

    join - boolean

    If true, the results will be added on to the document using the prefix key and the row id, else the results will be put in the pipeline context using

    Default: true

    preparedStatementKeys - array[string]

    The keys in the Pipeline Context to use to map request attributes into the prepared statement. These must map to the '?'s in your prepared statement. They must also be able to be resolved as the first parameter of that name in a request.

    prefix - string

    The string to use as a prefix for all values.

    validationQueryTimeout - integer

    The validation query timeout, the amount of time, in seconds, that connection validation will wait for a response from the database when executing a validation query. Use a value less than or equal to 0 for no timeout.

    Default: -1