运行报了如下错误,该如何解决?

来源:1-11 通过Hibernate API编写访问数据库的代码

qq_自由一日_0

2018-11-01 17:06

https://img2.mukewang.com/5bdac7fe0001ebc803260403.jpg

十一月 01, 2018 5:27:26 下午 org.hibernate.annotations.common.Version <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

十一月 01, 2018 5:27:26 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.4.Final}

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Configuration configure

INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

INFO: HHH000040: Configuration resource: /hibernate.cfg.xml

十一月 01, 2018 5:27:26 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity

WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: Students.hbm.xml

十一月 01, 2018 5:27:26 下午 org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity

WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

十一月 01, 2018 5:27:26 下午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

十一月 01, 2018 5:27:27 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)

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.

十一月 01, 2018 5:27:27 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

十一月 01, 2018 5:27:27 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

十一月 01, 2018 5:27:27 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///hibernate?useUnicode=true&characterEncoding=UTF-8]

十一月 01, 2018 5:27:27 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000046: Connection properties: {user=root, password=****}

十一月 01, 2018 5:27:27 下午 org.hibernate.engine.jdbc.internal.JdbcServicesImpl configure

WARN: HHH000342: Could not obtain connection to query metadata : The server time zone value '???ú±ê×??±??' 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.

十一月 01, 2018 5:27:27 下午 org.hibernate.dialect.Dialect <init>

INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

十一月 01, 2018 5:27:27 下午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation

INFO: HHH000422: Disabling contextual LOB creation as connection was null

十一月 01, 2018 5:27:27 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService

INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)

十一月 01, 2018 5:27:27 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>

INFO: HHH000397: Using ASTQueryTranslatorFactory

十一月 01, 2018 5:27:28 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

WARN: SQL Error: 0, SQLState: 01S00

十一月 01, 2018 5:27:28 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

ERROR: The server time zone value '???ú±ê×??±??' 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.


写回答 关注

1回答

  • 慕瓜5207574
    2018-11-06 16:49:55

    数据库连接不上,, 看驱动包都加载了没

Hibernate初探之单表映射

Java持久化框架Hibernate入门教程,掌握Hibernate基本概念

74810 学习 · 793 问题

查看课程

相似问题