title: MYSQL connection fail with netbeans
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11437178/unable-to-load-com-mysql-jdbc-driver">Unable to load com.mysql.jdbc.Driver</a>  </p>
  </blockquote>
  
  
  
  <p>Hello, I am trying to update my table, but the connection keeps failing. Following is the code I have: </p>
  
  <pre><code>try {
              String driver = "com.mysql.jdbc.Driver";
              Class.forName(driver).newInstance();
              Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql?zeroDateTimeBehavior=convertToNull","root","P@typd79");
              Statement stmt = con.createStatement();
              String query = "INSERT INTO project_one.personal_info(ssn,name,street,city,state,zip,class,degree,s,imm) VALUES"
                      + "(" + social + "," + Name + "," + Address + "," + City + "," + State + "," + Zip
                      + "," + Year + "," + Degree + "," + HS + "," + IMM + ")";
  
              stmt.executeUpdate(query);
              JOptionPane.showMessageDialog(null, "New student added successfully");
  
          } catch (Exception e) {
  
              JOptionPane.showMessageDialog(null,"Data not saved: " + e,"Error",JOptionPane.ERROR_MESSAGE);
  
          } 
  
      }
  </code></pre>
  
  <p>The connection name and driver are correct, but I am getting the following error <code>java.lang.classnotfound.exeption:com.mysql.jdbc.Driver.</code></p>
  
  <p>What is it that I am missing?</p>