为啥说数据库中表students不存在??

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

qq_永葆腹黑的蛙_03156515

2016-05-05 13:20

五月 05, 2016 1:10:01 下午 org.hibernate.annotations.common.Version <clinit>

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

五月 05, 2016 1:10:01 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.21.Final}

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Configuration configure

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

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

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

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Configuration addResource

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

五月 05, 2016 1:10:01 下午 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!

五月 05, 2016 1:10:01 下午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

五月 05, 2016 1:10:02 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

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

五月 05, 2016 1:10:02 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

五月 05, 2016 1:10:02 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

五月 05, 2016 1:10:02 下午 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]

五月 05, 2016 1:10:02 下午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

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

Thu May 05 13:10:02 CST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

五月 05, 2016 1:10:02 下午 org.hibernate.dialect.Dialect <init>

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

五月 05, 2016 1:10:02 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService

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

五月 05, 2016 1:10:02 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>

INFO: HHH000397: Using ASTQueryTranslatorFactory

Hibernate: 

    insert 

    into

        STUDENTS

        (SNAME, GENDER, BIRTHDAY, ADDRESS, SID) 

    values

        (?, ?, ?, ?, ?)

五月 05, 2016 1:10:03 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

WARN: SQL Error: 1146, SQLState: 42S02

五月 05, 2016 1:10:03 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions

ERROR: Table 'hibernate.students' doesn't exist

五月 05, 2016 1:10:03 下午 org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release

INFO: HHH000010: On release of batch it still contained JDBC statements


写回答 关注

1回答

  • Haibog
    2016-05-05 20:39:52

    可能是你没有导入mysql-connect 的jar包

    qq_永葆腹...

    问题其实是resource写成了resourse,hbm2ddl写成l了hbm2dd1。吐血ing

    2016-05-06 09:40:39

    共 1 条回复 >

Hibernate初探之单表映射

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

74810 学习 · 793 问题

查看课程

相似问题