Conexión de Java a MySQL

import java.sql.*;
public class Main {
    public static void main(String[] args) throws SQLException {
        Connection conectar = DriverManager.getConnection(
                "jdbc:mysql://localhost/mensajes_db?serverTimezone=UTC",
                "root",
                "123456"
        );
        System.out.println("Conexion Exitosa");
    }
}