MySQL SQLException time zone value is unrecognized

DrPils

Bekanntes Mitglied
Moin,

Wenn ich eine Verbindung zur Datenbank url aufbauen möchte bekomme ich eine Sql Exception
java.sql.SQLException: The server time zone value 'Mitteleurop�ische Zeit' 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.
Ich habe den MySQL Connector 8.0.20 eingebunden. Ich habe keine Ahnung an was es liegt. Wäre schön wenn mir jemand helfen kann.
Am Code wird es wohl nicht liegen, aber der Vollständigkeit halber:
Java:
public class JdbcTest {


    public static void main(String[] args) {

        Connection connection = null;
        Statement statement = null;
        ResultSet resultSet = null;

        String dbUrl = "jdbc:mysql://localhost:3306/demo";
        String user = "student";
        String pass = "student";

        try {
            connection = DriverManager.getConnection(dbUrl, user, pass);
            statement = connection.createStatement();
            resultSet = statement.executeQuery("SELECT * FROM  demo");

            while (resultSet.next()) {
                //do some stuff
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
 

Zurück
Oben