Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa EJB java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


krishna patel
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
1 Answer(s)      3 years and 8 months ago
Posted in : EJB


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
     try
     {
        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


Advertisement
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:
Advertisements
 

 

 

DMCA.com