Amazon RDS Bad Request Exception

Viewed 336

I am trying to query our database and map the results to a list of models. I am currently getting the following exception: Request type not supported: class com.amazon.rdsdataservice.ExecuteStatementRequest RequestID: Removed (Service: AWSRDSData; Status Code: 400; Error Code: BadRequestException; Request ID: Removed )

I wrote the rest of the code that queries the database and had no issues, this is the first instance where I am getting this exception.

Here is the method throwing the exception, it is occurring on the execute line.

public List<CompanyReportingTable> getCompanyReportingData(String monthsBack) {
    List<CompanyReportingTable> reportingData = new ArrayList<>();
    try {
        Map<String, String> param = new LinkedHashMap<>();
        param.put("monthsBack", monthsBack);
        //Below is the line throwing the exception
        reportingData = rdsDataClient.forSql(COMPANY_REPORTING_EXTRACTION_QUERY).withParameter(param).execute().mapToList(CompanyReportingTable.class);
    } catch (Exception ex) {
        LOGGER.error("Exception while querying company reporting data: " + ex.getMessage(), ex);
    }
    return reportingData;
}

I have made sure that the query is valid SQL and runs in the RDS query editor. I have been unable to find similar questions, any help would be appreciated.

0 Answers
Related