Like the title says, I'm trying to connect to my database through a singleton design pattern but it doesn't seem to be connect and I can't find the problem.
public class DatabaseConnection {
private static Connection conn;
static{
try{
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/athentication", "root", "");
System.out.println("connected");
}catch(SQLException e){
System.out.println(e);
}
}
public static Connection getCon(){
return conn;
}
}
I also tried verifying the connectivity through main but the "connected" message doesn't appear in the console and I get this as well:
java.sql.SQLException: The server time zone value 'Malay Peninsula Standard Time' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.