Hi,
I'm connecting to MySql DB using the Code below (I copied from the internet)
I'm trying to understand what this code does exactly.
Can someone please explains what the line Class.forName does? I tried to read in the Java API but I still don't get it.
Thanks
String userName = "root";
String password = "root";
String url = "jdbc:mysql://localhost:3306/test";
Class.forName ("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");