JDBC Index Stage
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.
You must first upload the JDBC driver to Fusion. |
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.
|