Share on Google+Share on Google+

krishna patel
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
1 Answer(s)      6 years and a month 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

Ads

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:
Tutorials   
Java Spring Hibernate Struts Training email verification in e commerce application email verification in e commerce application EJB interceptors Demo How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ??? RUNNING EJB PROGRAMS Issue when deploying mdb jar in weblogic Weblogic8 server problem login module program login module program jsp project Lookup failed in SessionBean mahesh How to display single row from sql server 2005 how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL how to access radio buttons selected in a servlet??...iam unable to retrieve values...it is returning NULL Stateless Bean Error Stateless Session Bean Example Error EJB Deployment how to create a simple ejd session bean and how to do project setup Ejb Module Ejb Module EJB JSP - Checkbox remain checked although checked values should depend on values stored in a stateful session bean Session Bean Example Bean RMI ejb ejb webservices message driven bean example entity bean j2ee example programs Rose India Stateless Session Bean Example Question Coding with Ejb EJB with NetBeans Run a simple EJB code Run a simple EJB code Used Handicap Vans Issue in Stateless session bean example ejb ejb methods can be invoked by the container on a stateless session bean session Join problem with JPA Criteria Builder About Web-Logic Abut Deploying and Developing Web-Logic in JDK1.5 version to run the EJB managing the transactions Pagination DataGrid without DataBase Many To Many annotation in ejb use of ejb 3.0

Ads

 
Advertisement null

Ads