I am new to JDBC and I am trying to make a connection to a MySQL database. I am using Connector/J driver, but I cant find the JDBC connection string for my Class.forName() method.
Class.forName()
Assuming your driver is in path,
String url = "jdbc:mysql://localhost/test"; Class.forName ("com.mysql.jdbc.Driver").newInstance (); Connection conn = DriverManager.getConnection (url, "username", "password");
1.4m articles
1.4m replys
5 comments
56.9k users