From 098e2f2671dfb84474999f649b2cc19113d4b139 Mon Sep 17 00:00:00 2001 From: Wellington Santos Date: Sat, 24 Oct 2020 14:32:32 -0700 Subject: [PATCH] =?UTF-8?q?Solu=C3=A7=C3=A3o=20para=20erro=20com=20TimeZon?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Após executar o código, e ver o seguinte erro ocorrendo: "The server time zone value 'Hor. de Ver?o do Pac?fico (EU' 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 specific time zone value if you want to utilize time zone support." Pude analisar que o timezone estava incompatível, e consegui achar essa solução, espero que possa ajudar outros que tiverem o mesmo problema --- .../src/code/unidade4/secao2/bd/ConexaoBD.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Livro-POO-Java-Netbeans/src/code/unidade4/secao2/bd/ConexaoBD.java b/Livro-POO-Java-Netbeans/src/code/unidade4/secao2/bd/ConexaoBD.java index 28662fc..0f6228b 100644 --- a/Livro-POO-Java-Netbeans/src/code/unidade4/secao2/bd/ConexaoBD.java +++ b/Livro-POO-Java-Netbeans/src/code/unidade4/secao2/bd/ConexaoBD.java @@ -17,13 +17,14 @@ public class ConexaoBD { private final String nomeHost = "localhost"; private final String portaBD = "3306"; private final String nomeBD = "bd_empresa"; //colocar o nome do seu banco de dados + private final String tempo = "?useTimezone=true&serverTimezone=UTC"; private final String nomeUsuario = "root"; //colocar o nome de seu usuario private final String senha = ""; //colocar a sua senha private String url = null; public ConexaoBD() { //"jdbc:mysql://localhost:3306/bd_empresa"; - url = prefixoBD + nomeHost + ":" + portaBD + "/" + nomeBD; + url = prefixoBD + nomeHost + ":" + portaBD + "/" + nomeBD + tempo; } public Connection getConexao() {