how to check user privileges to connect database db2 code example Example: how to give select privileges to user in db2 db2 grant dataaccess on database to user winuser1