How to check DB2 SYSADM or SYSCTRL authorization for a user.
I need to verify user/password by means of DB2 authority to create/drop database. Is there any specific command for this?
I need to verify user/password with a command that tells whether the user has the authority to create and drop database (means attempt to validate before firing database Create command) or not.
Try this; It's implied that the ID has SELECT on the views referenced in the query below;
A SQL0551 on the above query would also be an indication that the connected user does not have SYSADM.
"GET AUTHORIZATIONS"
command is discontinued in Version 9.7."AUTH_LIST_AUTHORITIES_FOR_AUTHID"
table function should be used instead.Link: GET AUTHORIZATIONS command has been discontinued
This is how I would do it in from unix shell, it shouldn't be to hard to adapt to the java equivalent;