title: PrepareStatement not working in select query java
body: <pre><code>String checkq="select * from "+Dbc.TB_COMPANY+" where cmp_name=? and cmp_id!=?";
          pst=con.prepareStatement(checkq);
                  pst.setString(1,"test"); pst.setString(2,"2")
          rs=st.executeQuery(checkq);
  </code></pre>
  
  <p><strong>shows</strong>
  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''13a'' and cmp_id!=3' at line 1</p>