i did project in netbeans 7.3.1 version and converted as jar if i run the jar from the dist folder means its work properly. if i copy and paste in desktop and run means it shows java.lang.classnotfoundexception:com.mysql.jdbc driver message will show. i could not find exactly. why it shows like that and what is the solution for it. please help me. am new to this netbeans... but added the mysql connector jar file in project. but it shows that error. please help me here is my code
package aam;
import java.sql.*;
import javax.swing.*;
public class Connect {
Connection con=null;
public static Connection ConnectDB(){
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/tnpcb","root","");
return con;
}
catch(ClassNotFoundException | SQLException e){
JOptionPane.showMessageDialog(null, e);
return null;
}
}
}