java.sql.SQLWarning: Unknown table '_leavemessage'

22:22:44,156 INFO Environment:500 - Hibernate 3.2.0 22:22:44,156 INFO Environment:533 - hibernate.properties not found 22:22:44,156 INFO Environment:667 - Bytecode provider name : cglib 22:22:44,156 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling 22:22:44,203 INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml 22:22:44,203 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml 22:22:44,375 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] 22:22:44,375 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ 22:22:44,375 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath 22:22:44,406 DEBUG Configuration:1311 - hibernate.connection.url=jdbc:mysql://localhost/hibernate_first 22:22:44,406 DEBUG Configuration:1311 - hibernate.connection.driver_class=com.mysql.jdbc.Driver 22:22:44,406 DEBUG Configuration:1311 - hibernate.connection.username=root 22:22:44,406 DEBUG Configuration:1311 - hibernate.connection.password=admin 22:22:44,421 DEBUG Configuration:1311 - hibernate.dialect=org.hibernate.dialect.MySQLDialect 22:22:44,421 DEBUG Configuration:1311 - hibernate.show_sql=true 22:22:44,421 DEBUG Configuration:1510 - null <-org.dom4j.tree.DefaultAttribute@19dfbff [Attribute: name resource value "com/hibernate/User.hbm.xml"] 22:22:44,421 INFO Configuration:507 - Reading mappings from resource: com/hibernate/User.hbm.xml 22:22:44,421 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] 22:22:44,421 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ 22:22:44,421 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath 22:22:44,500 INFO HbmBinder:300 - Mapping class: com.hibernate.User -> User 22:22:44,500 DEBUG HbmBinder:1270 - Mapped property: id -> id 22:22:44,515 DEBUG HbmBinder:1270 - Mapped property: name -> name 22:22:44,515 DEBUG HbmBinder:1270 - Mapped property: password -> password 22:22:44,515 DEBUG HbmBinder:1270 - Mapped property: createTime -> createTime 22:22:44,515 DEBUG HbmBinder:1270 - Mapped property: expireTime -> expireTime 22:22:44,515 INFO Configuration:1465 - Configured SessionFactory: null 22:22:44,515 DEBUG Configuration:1466 - properties: {hibernate.connection.password=admin, 22:22:44,531 INFO Dialect:141 - Using dialect: org.hibernate.dialect.MySQLDialect 22:22:44,562 DEBUG Configuration:1044 - processing extends queue 22:22:44,578 DEBUG Configuration:1048 - processing collection mappings 22:22:44,578 DEBUG Configuration:1059 - processing native query and ResultSetMapping mappings 22:22:44,578 DEBUG Configuration:1067 - processing association property references 22:22:44,578 DEBUG Configuration:1089 - processing foreign key constraints 22:22:44,625 DEBUG Configuration:1044 - processing extends queue 22:22:44,625 DEBUG Configuration:1048 - processing collection mappings 22:22:44,625 DEBUG Configuration:1059 - processing native query and ResultSetMapping mappings 22:22:44,625 DEBUG Configuration:1067 - processing association property references 22:22:44,625 DEBUG Configuration:1089 - processing foreign key constraints 22:22:44,625 INFO SchemaExport:154 - Running hbm2ddl schema export 22:22:44,625 DEBUG SchemaExport:170 - import file not found: /import.sql 22:22:44,625 INFO SchemaExport:179 - exporting generated schema to database 22:22:44,625 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!) 22:22:44,625 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20 22:22:44,625 INFO DriverManagerConnectionProvider:45 - autocommit mode: false 22:22:44,640 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/hibernate_first 22:22:44,640 INFO DriverManagerConnectionProvider:83 - connection properties: {user=root, password=admin} 22:22:44,640 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0 22:22:44,640 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection 22:22:44,843 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:mysql://localhost/hibernate_first, Isolation Level: 4 drop table if exists User 22:22:44,843 DEBUG SchemaExport:303 - drop table if exists User 22:22:44,875 DEBUG JDBCExceptionReporter:40 - SQL Warning java.sql.SQLWarning: Unknown table 'user' at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:722) at com.mysql.jdbc.SQLError.convertShowWarningsToSQLWarnings(SQLError.java:650) at com.mysql.jdbc.Statement.getWarnings(Statement.java:1657) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:309) at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:284) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:186) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133) at com.hibernate.ExportDB.main(ExportDB.java:15) 22:22:44,875 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02 22:22:44,875 WARN JDBCExceptionReporter:49 - Unknown table 'user' create table User (id varchar(255) not null, name varchar(255), password varchar(255), createTime datetime, expireTime datetime, primary key (id)) 22:22:44,875 DEBUG SchemaExport:303 - create table User (id varchar(255) not null, name varchar(255), password varchar(255), createTime datetime, expireTime datetime, primary key (id)) 22:22:44,875 ERROR SchemaExport:274 - Unsuccessful: create table User (id varchar(255) not null, name varchar(255), password varchar(255), createTime datetime, expireTime datetime, primary key (id)) 22:22:44,875 ERROR SchemaExport:275 - The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working 22:22:44,875 INFO SchemaExport:196 - schema export complete 22:22:44,875 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1 22:22:44,875 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:mysql://localhost/hibernate_first

 

 

出现这样的错误时正常的情况,因为你在创建表的时候在数据库里面还没有你要创建的表,所以它开始创建表的时候它首先是从数据库里面去查找有没有你要创建的表,当有就删除,当没有找到就会报这样一个错误。 当你在第二次运行exportToDatabase中的这个文件的时候就不会出现上面的错误了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值