I'm getting this error while trying to establish connection with database MySQL
java.sql.SQLException: The server time zone value 'CEST' 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.
connection with MySQL is done this way:
private String CONN_STRING = "jdbc:mysql://localhost:3306/vmenginedatabaseT04P/"; // "jdbc:mysql://localhost:3306/vm_database_1";
private boolean connected ;
private Connection connection;
public boolean isConnected() {
return connected;
}
public Connection Connect() {
Connection conn = null;
try {
Class.forName("com.mysql.cj.jdbc.Driver");
conn = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD);
System.out.println("Connected");
connected = true;
return conn;
} catch (SQLException e) {
System.err.println(e);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}