Error while connecting to db2

db2

While trying to connect to db2 , I am getting the following error

Connection failed: db2 sql error: sqlcode=-1060,sqlstate=08004

I tried to do a lookup on

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2z9.doc.codes/src/tpc/n514.htm

but don't see any meaning of the error message pertaining to this sqlcode. Please suggest on how to resolve this issue.

Best Answer

This is the correct error:

SQL1060N User "" does not have the CONNECT privilege.

Explanation:

The specified authorization ID does not have the CONNECT privilege to access the database. The CONNECT privilege must be granted before the user can connect to a database. This error is also returned when a switch user request is made with a user ID allowed on the trusted connection but that user ID does not hold CONNECT privilege on the database. The connection is put in an unconnected state.

Federated system users: This situation can also be detected by the data source

The command cannot be processed.

User response:

Contact the system administrator or database administrator for the database and request a GRANT CONNECT for the authorization ID. Resubmit the command.

If this error is returned as a result of a switch user request, then until a switch user request with a valid user ID is made (the user ID that established the trusted connection or a user ID allowed on the trusted connection), if any SQL statement is issued, an error is returned (SQLSTATE 08003). The connection remains trusted when it is taken out of the unconnected state.

Federated system users: if necessary isolate the problem to the data source that rejected the request (see the Troubleshooting Guide for procedures to follow to identify the data source that failed) and ensure that correct privileges have been granted for that data source. Some data sources might use a different name than the CONNECT privilege for the privilege required to connect to a database.

sqlcode: -1060

sqlstate: 08004

Related Topic