Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Problema con connessione MYBATIS

    ciao!

    sto cercando di usare mybatis, ma ho un problrema:
    codice:
    Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
    Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: 
    ### Error querying database.  Cause: 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.
    ### The error may exist in ClienteMapper.xml
    ### The error may involve com.b2b.rest.ClienteMapper.getByLike
    ### The error occurred while executing a query
    ### Cause: 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.
    .......................................................
    come posso risolvere??

  2. #2
    risolto nella configurazione della connessione:

    codice:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPEconfigurationPUBLIC"-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd">
    <configuration>
    
        <typeAliases>
            <typeAlias type="com.b2b.rest.Cliente" alias="Cliente"></typeAlias>
        </typeAliases>
    
        <environments default="development">
            <environment id="development">
                <transactionManager type="JDBC"/>
                <dataSource type="POOLED">
                    <property name="driver" value="com.mysql.cj.jdbc.Driver"/>
                    <property name="url" value="jdbc:mysql://localhost:3306/cronos3?serverTimezone=UTC"/>
                    <property name="username" value=""/>
                    <property name="password" value=""/>
                </dataSource>
            </environment>
        </environments>
    
        <mappers>
            <mapper resource="ClienteMapper.xml"/>
        </mappers>
    
    </configuration>

    aggiungendo serverTimezone.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.