Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver



Share on Google+Share on Google+

krishna patel
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
1 Answer(s)      6 years and 5 months ago
Posted in : EJB
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        Class<?> forName = Class.forName("com.mysql.jdbc.Driver");
      Connection conn =  DriverManager.getConnection("jdbc:mysql://localhost/krishna","krishna","krishna");
      Statement stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("INSERT INTO APP.TRIAL_TABLE VALUES ('"+jTextField1.getText()+"','"+jTextField2.getText()+"','"+jTextField3.getText()+"','"+jTextField4.getText()+"'");


catch (Exception e) { System.out.println(e); }


public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new tryk().setVisible(true);

SHOWS ME FOLLOWING ERROR : java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

View Answers

March 8, 2011 at 11:31 AM

Do you have mysql-connector-java-5.0.5.jar? If not then install it and set its path.


Related Tutorials/Questions & Answers: