I tried searching for a solution but the questions on this website just weren't the answer I'm looking for.
I tried running:
private static final String USERNAME= "root";
private static final String PASSWORD= "root";
private static final String CONN_STRING= "jdbc:mysql//localhost:3306/java";
conn Connection = null;
try{
conn = DriverManager.getConnection(CONN_STRING, USERNAME, PASSWORD);
System.out.println("Connected");
} catch (SQLException e){
System.err.println(e);
}
I've got the 8.0.12 version of both server and connector.
Your JDBC URL should follow jdbc:mysql://localhost/test
format as per
7.1 Connecting to MySQL Using the JDBC DriverManager Interface docs.
You are missing a semicolon after mysql
part, it should be
private static final String CONN_STRING = "jdbc:mysql://localhost:3306/java";