Create table query in DB2
<p>I want to create DB2 table with from Java code. I tested this code but I get error:</p>

<blockquote>
  <p>com.ibm.db2.jcc.am.SqlException: [jcc][10103][10941][4.19.26] Method
  executeQuery cannot be used for update. ERRORCODE=-4476, SQLSTATE=null</p>
</blockquote>

<pre><code>public void testDB2TableWithRandomData() throws Exception
    {
        System.out.println("\nTesting SQL query for DB2 test table and data\n");
        try
        {
            Class.forName("com.ibm.db2.jcc.DB2Driver");
        }
        catch (ClassNotFoundException e)
        {
            System.out.println("Please include Classpath  Where your DB2 Driver is located");
            e.printStackTrace();
            return;
        }
        Connection conn = null;
        PreparedStatement pstmt = null;
        ResultSet rset = null;
        try
        {
            conn = DriverManager.getConnection("jdbc:db2://34.137.10.143:20002/SAMPLE", "db2inst1", "pass");
            if (conn != null)
            {
                System.out.println("DB2 Database Connected");
            }
            else
            {
                System.out.println("DB2 connection Failed ");
            }
            pstmt = conn.prepareStatement("CREATE TABLE EMPL (ENO INTEGER, LASTNAME VARCHAR(30), HIREDATE DATE, SALARY INTEGER)");
            rset = pstmt.executeQuery();
            if (rset != null)
            {
                while (rset.next())
                {
                    System.out.println("Status: " + rset.getString(1));
                }
            }
        }
        catch (SQLException e)
        {
            System.out.println("DB2 Database connection Failed");
            e.printStackTrace();
            return;
        }
    }
</code></pre>

<p>What is the proper way to create table from Java code?</p>