AnsweredAssumed Answered

API Gateway-Perform JDBC Query is not working with input parameter passed using a context variable

Question asked by Rudra_Singh on Apr 11, 2017
Latest reply on Apr 11, 2017 by Rudra_Singh

Trying to perform JDBC Query to get the resource_owner value for an OauthToken in incoming request. Tried setting the context variable for OAuth token and pass it to a simple query to get the corresponding "resource_owner" detail.

 

select resource_owner from oauth_token where token= "${Token}";

 

where Token is the context variable set to ${request.http.parameter.access_token} in incoming request.

The query is failing with error:

 

Perform JDBC Query failed due to: Parameter index out of range (1 > number of parameters, which is 0).

It looks like the query is not getting the value from the context variable and it is failing.

When i hardcode the token value the query works.

Outcomes