title: How to grant privileges to current user
body: <p>I'm trying to make a java application that uses a database. I've downloaded db2 and created a user 'student'. I have the following lines in my program:</p>
  
  <pre><code>con = DriverManager.getConnection(url, "student", "xxxxxx"); 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ResultSet rs= stmt.executeQuery("SELECT sifra, naziv " +
                          " FROM predmet " +
                          " WHERE bodovi &gt; 20" );
  </code></pre>
  
  <p>And the second one throws a SqlSyntaxErrorException with the following message: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501.</p>
  
  <p>So I looked it up and it seems that the user doesn't have the required level of privilege. So when I tried to run the query in db2 command line, I got:</p>
  
  <blockquote>
    <p>The statement failed because the authorization ID does not have the required authorization or privilege to perform the operation. Authorization ID: "STUDENT".  Operation: "SELECT".</p>
  </blockquote>
  
  <p>So since obviously I barely know what I'm doing, I don't know how to grant 'student' the necessary privileges. That is, I don't know what user could give him the privileges since I never created another user. I've seen 'db2admin' mentioned (I'm using windows), but I don't know what to do with that piece of information. I don't know how to check the existing users or which password to use for db2admin (if that's even possible).</p>