javadatabasedb2jboss7.xjboss6.x

JBoss 7.4 DB2 Datasource with valid credentials returns -551 SQL error when accessed by application


I have a JBOSS EAP 7.4 instance set up with 2 DB2 Datasources. I have confirmed the credentials are valid and working. I changed them to invalid credentials to ensure I was not getting a false positive with the connection test via management GUI.

The application server starts up fine showing good logs for the Datasource start up and tests but returns Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501 when my application tries to run a query and pull data. Any ideas as to what could cause this? The error guide for DB2 states this is

-551 auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation ON OBJECT object-name

Authorization IDs or roles were checked for authorization to perform an operation on a Db2 object. None of the authorization IDs or roles were authorized to perform the operation.

I expected there to be invalid credentials as a root cause for this -551 SQL error, but I am able to query using those credentials. Additionally, I have a build of this application running with JBOSS EAP 6.4.5 that uses the same credentials and Datasource details, this can pull data successfully. Any ideas are greatly appreciated!


Solution

  • Upon looking deeper at what the query was pulling we found a DB view that our userID was not given access too. This solved the issue!