ClassNotFoundException: com.mysql.jdbc.Driver [duplicate]
This question already has an answer here: ClassNotFoundException com.mysql.jdbc.Driver [duplicate] 21 answers Connect Java to a MySQL database 13 answers This question has been asked a lot here, but i still can't fix my problem: I put mysql-connector-java-5.1.18-bin into C:\Program Files\Java\jre6\lib\ext folder. I have this code: // Load the database driver Class.forName("com.mysql.jdbc.Driver"); // Get a connection to the database Connection conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/mysql", "root", "4958ps"); // Get a statement from the connection Statement stmt = conn