title: Java login program using SQL
body: <p>I am making a program for my school store, and would like some assistance from you brilliant people. </p>
  
  <p>I've looked through SQL tutorials on the workbench, and I've looked up some videos on how to do what I'd like to achieve, but, I'm terrible with SQL for the time being. I have a snippet of my code, and it'd be wonderful if one of you better-versed with SQL could help me out with the errors. </p>
  
  <pre><code>class loginButton implements ActionListener{
  
      public void actionPerformed(ActionEvent e) {
          Connection connection;
          PreparedStatement ps;
          try {
              connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/userlist", "root", "Hadasada3!");
              ps = connection.prepareStatement("SELECT `username`, `password` FROM `userlist` WHERE `username` = ? AND `password` = ?");
              ps.setString(1, textUsername.getText());
              ps.setString(2, String.valueOf(textPassword.getPassword()));
              ResultSet result = ps.executeQuery();
              if(result.next()){
                  JOptionPane.showMessageDialog(null, "Login Success.");
                  String[] args = null;
                  CowboyCorral.main(args);
                  dispose();
              }
              else{
                  JOptionPane.showMessageDialog(null, "Login Failed.");
              }
          } catch (SQLException ex) {
              Logger.getLogger(CCLogin.class.getName()).log(Level.SEVERE, null, ex);
          }
        }
      }
      buttonLogin.addActionListener(new loginButton());
  </code></pre>
  
  <p>I'm using Eclipse, and a modified example code from workbench. I have the SQL workbench running a database on <code>localhost</code> on port <code>3306</code>, the SCHEMA and the table is called <code>userlist</code>.When this code is in text, it shows no errors. When I run the program and push the login button, it says <code>No suitable driver found for jdbc:mysql://localhost:3306/userlist</code>. I can give additional error information if needed, but if someone could point me in the right direction, or maybe even tell me where my fault is, that would be greatly appreciated. </p>
  
  <p>I also have the <code>mysql-connector-java-5.1.38-bin.jar</code> in my referenced libraries of the project. </p>