I'm trying to establish a connection to my database (MySQL) and I have searched a code online that looks like this, but what he uses is an Oracle database, not a MySQL database which is what I have used.
Can somebody help? This is my code...
public static Connection DB()
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver"); //This is my problem
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/Image","root","");
return con;
} catch (ClassNotFoundException | SQLException e) {
JOptionPane.showMessageDialog(null, e);
}
return null;
}
[This is the image of my error message.][1]