title: Comparing user input to mysql database value
body: <pre><code>public void datuieguve(){
      Scanner ievads = new Scanner(System.in);
      String lietotIn = ievads.next();
  //  String paroleIn = ievads.next();
      try {           
          quer = savien.createStatement();
          String kverijs = "select lietotajvards from lietotaji where lietotajvards = '" +lietotIn+ "';";
          rezult = quer.executeQuery(kverijs);
          System.out.println(rezult.next());
          String lietotajvards = rezult.getString("lietotajvards");
  
          if (rezult.equals(lietotIn))
          {
              System.out.println("Yup");
          }
          else
          {
              System.out.println("Nope");
          }   
      } catch(Exception ex) {
              System.out.println("Kluuda: " +ex); 
      }
      ievads.close();
  }
  </code></pre>
  
  <p>Hi guys, I'm trying to create a code that will take user input and compare it with mysql database value. The problem is, it's not working and I'm stuck. I'd appreciate if someone could figure out what's wrong with my code and give me some tips or something, because I can't  :)</p>
  
  <p>I think I got down the connection part but the comparison is driving me nuts.</p>