title: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.STAFF, DRIVER=4.22.29
body: <p>I have database DB2 SAMPLE in server 10.74.44.65:51020
  I'm trying connect to staff table in database but i got an exception.
  I use db2jcc4 of IBM.                                                                                                                                                         </p>
  
  <pre><code>Connection successfully
  Test 1
  com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DB2ADMIN.STAFF, DRIVER=4.22.29
      at com.ibm.db2.jcc.am.ld.a(ld.java:810)
      at com.ibm.db2.jcc.am.ld.a(ld.java:66)
      at com.ibm.db2.jcc.am.ld.a(ld.java:140)
      at com.ibm.db2.jcc.am.up.c(up.java:2796)
      at com.ibm.db2.jcc.am.up.d(up.java:2784)
      at com.ibm.db2.jcc.am.up.a(up.java:2212)
      at com.ibm.db2.jcc.t4.bb.i(bb.java:148)
      at com.ibm.db2.jcc.t4.bb.b(bb.java:41)
      at com.ibm.db2.jcc.t4.p.a(p.java:32)
      at com.ibm.db2.jcc.t4.vb.i(vb.java:145)
      at com.ibm.db2.jcc.am.up.lb(up.java:2181)
      at com.ibm.db2.jcc.am.up.a(up.java:3300)
      at com.ibm.db2.jcc.am.up.a(up.java:717)
      at com.ibm.db2.jcc.am.up.executeQuery(up.java:696)
      at Main.main(Main.java:24)
  </code></pre>
  
  <p>My Java Code. 10.74.44.65 is location ip of server .
  Database connected but i cannot execute sql query.</p>
  
  <pre><code>import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.Statement;
  
  public class Main {
      public static void main(String[] argv) {
          try {
              Class.forName("com.ibm.db2.jcc.DB2Driver");
          }
          catch (ClassNotFoundException e) {
              e.printStackTrace();
              return;
          }
          Connection conn;
          Statement  stmt;
          ResultSet rs;
          try {
              conn = DriverManager.getConnection("jdbc:db2://10.74.44.65:51020/SAMPLE","db2admin","Us3admin");
              System.out.println("Connection successfully");
              stmt=conn.createStatement();
              System.out.println("Test 1");
              rs=stmt.executeQuery("select * from staff");
              System.out.println("Test 2");
              while (rs.next()) {
                  System.out.println("Employee number = " + rs.getString(1));
                }
          } catch (SQLException e) {
              e.printStackTrace();
              return;
          }
      }
  
  }
  </code></pre>