title: SEVERE: null com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Admin' in 'where clause'
body: <p>I still could not find out why my SQL statements cannot run on my JAVA program, but they run on the Workbench!</p>
  
  <p>I am trying to make an interface where users can register or login. 
  To Register, I have this error:</p>
  
  <blockquote>
    <p>SEVERE: null
    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Admin' in 'field list'</p>
  </blockquote>
  
  <p>I have a username "Admin" on the database that I can see on workbench </p>
  
  <p>Also If I click on the button Clear, and type OK it does not give the error of registering and I can see the table of data I have, because it skips the part of trying to register the code since the strings are empty and runs the else block; </p>
  
  <p>(Code on MyUserApp Class)</p>
  
  <pre><code>private void RegisterButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
      String username, password, address, dob;
      try {
          // TODO Register very important too!
          username = newUsernameField.getText();
          password = passwordField2.getText();
          address = addressField.getText();
          dob = dateofbField.getText();
  if( username == null || password == null || username.isEmpty() || password.isEmpty() || password.length() &lt; 6 ) 
              jLabel6.setText("The information you typed in is not valid. ");
          else{
                  this.app.registerUser(app, username, password, dob, address);
  
                  }
          String u = this.app.showDB(app);
          showTableDB.setText(u);
      } catch (SQLException ex) {
          Logger.getLogger(UserAppUI.class.getName()).log(Level.SEVERE, null, ex);
      }
  }                
  </code></pre>
  
  <p>(Code on the UI Class)</p>
  
  <pre><code>public void registerUser(MyUserApp app, String username, String pw, String dob, String address) throws SQLException{
  
      String sb = "INSERT INTO javabase.user (iduser, username, password, date_of_birth, address)\n VALUES (" + app.incID()+", "+username+", "+pw+", "+dob+", "+address +");";
      PreparedStatement statement = app.getCon().prepareStatement(sb);
      statement.execute();
  }
  </code></pre>
  
  <p>This happens when i try to login
  <a href="https://prnt.sc/gajpns" rel="nofollow noreferrer">https://prnt.sc/gajpns</a></p>
  
  <p>And this happens when I try to register:
  <a href="https://prnt.sc/gak3uh" rel="nofollow noreferrer">https://prnt.sc/gak3uh</a></p>
  
  <p>The code that makes users login is basically this:</p>
  
  <pre><code>this.app.login(this.app, username, pw); 
  </code></pre>
  
  <p>on the UI class, that calls this one:</p>
  
  <pre><code> public void login(MyUserApp app, String user, String pw) throws SQLException{
  
      String sql = "SELECT * FROM javabase.user WHERE username = "+ user +" and password = "+pw+";";
      PreparedStatement statement = app.getCon().prepareStatement(sql);
      statement.execute();
  }
  </code></pre>