title: connect a java program to mysql in netbeans
body: <p>I'm trying to connect a java program in netbeans using the mysql j connector i get an exception message saying <code>com.mysql.jdbc.Driver</code> this my code </p>
  
  <pre><code>package testdb;
  
  import java.sql.*;
  
  public class Testdb {
  
      /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          String url = "jdbc:mysql://localhost:3306/location";
          String login = "root";
          String pass = "";
          try
          {
              Class.forName("com.mysql.jdbc.Driver");
              Connection con = DriverManager.getConnection(url,login,pass);
              Statement s = con.createStatement();
              ResultSet r = s.executeQuery("select * from reservation");
              while(r.next())
              {
                  System.out.println("id reservation = "+r.getInt("id_reservation"));
              }
  
          }catch (Exception e) 
          {
               System.out.println(e.getMessage());
          }
      }
  }
  </code></pre>