Guest User

Untitled

a guest
Jan 24th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public void MySQLConnection() throws Exception {
  2. try {
  3. Class.forName("com.mysql.cj.jdbc.Driver");
  4. Conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/" + "hibernate_db?useTimezone=true&serverTimeZone=America/Mexico_City&useSSL=false", "admin", "password");
  5. //Conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306?useLegacyDatetimeCode=false&serverTimezone=UTC" + "hibernate_db", "admin", "password");
  6. System.out.println("Se ha iniciado la conexión con el servidor de forma exitosa");
  7. } catch (ClassNotFoundException ex) {
  8. Logger.getLogger(MySQL.class.getName()).log(Level.SEVERE, null, ex);
  9. } catch (SQLException ex) {
  10. Logger.getLogger(MySQL.class.getName()).log(Level.SEVERE, null, ex);
  11. }
  12.  
  13. <dependency>
  14. <groupId>mysql</groupId>
  15. <artifactId>mysql-connector-java</artifactId>
  16. <version>8.0.14</version>
  17. </dependency>
  18.  
  19. Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Hora estándar central (México' 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.
  20. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  21.  
  22. SET GLOBAL time_zone = '-6:00';
  23.  
  24. java.sql.SQLException: Unknown system variable 'query_cache_size'
Add Comment
Please, Sign In to add comment