Specific method responses for Db2

A successful response generates an HTTP status code of 200. Failures produce an appropriate status code and an error message describing the cause of the failure.

Z Data Tools Service Provider generates the following JSON format in response to a successful specific method request for Db2® data:
{
    "rows" :
    [
        {
            "last" : boolean,
            "columns" :
            {

                "column1-name" : "value",
                "column2-name" : "value",
                "column3-name" : "value",
                "columnn-name" : "value"
            }
        }
    ],
    "token" : "string"
}

Key fields for a specific method response are explained in the following table:

Key Description
rows An array of 0 or more rows from the Db2 result table.
last If present, indicates whether the row is the last in the Db2 result table.
columns An object containing 1 or more row columns and their values.
column1-name
columnn-name
The key is the name of the column. The value is the value of the column.
token A Z Data Tools session token. A token is returned when a request sets "session" : true and does not also pass a token value. The token represents a ZDT/Db2 session running in the z/OS® environment and can be used by subsequent requests when multiple reads by a client are required.

To end the ZDT/Db2 session, the client must send a request with the token and "session" : false, otherwise the session will eventually time out if inactive.