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中的这个文件的时候就不会出现上面的错误了。
分享到:
相关推荐
JAVA连接各种数据库的方法和代码,非常适合JAVA的初学者,可能也适合忘记连接代码的工作人员!
错误 严重度 描述(消息文本) 1 10 上次升级的版本日期: 10/11/90. 21 10 警告:严重错误 %1! 发生于 %2!。请记下错误和时间,然后与系统管理员联系。 102 15 在 ''%1!'' 附近有语法错误。...104 15 如果语句中包含 ...
import java.sql.SQLWarning; import java.sql.Savepoint; import java.sql.Statement; import java.util.Map; public class SimplePooledConnection implements InvocationHandler { // Fields private static ...
java 实现连接sql server 20002007-12-16 13:28:00.0 第一种:通过ODBC连接数据库 JAVA语言的跨平台的工作能力(Write Once ,Run Anywhere)、优秀的图像处理能力(我相信现在没有那种语言可以超过JAVA在网络上的...
System.out.println("sqlWarning.getErrorCode() = " + sqlWarning.getErrorCode()); System.out.println("sqlWarning.getSQLState() = " + sqlWarning.getSQLState()); System.out.println("sqlWarning.getMessage...
定义异常捕获类型及处理方法: DECLARE handler_action HANDLER FOR condition_value [, condition_value] ... statement handler_action: CONTINUE ... | SQLWARNING | NOT FOUND | SQ
5.5 使用ALTER TABLE改变表 5.6 删除或取消表 5.7 创建基于Swing的表构建器 5.7.1 控制程序 5.7.2 视图 5.7.3 模型 5.8 小结 第6章 插入、更新和删除数据 6.1 使用SQL INSERT插入数据 6.1.1 INSERT语句 ...
5.5 使用ALTER TABLE改变表 5.6 删除或取消表 5.7 创建基于Swing的表构建器 5.7.1 控制程序 5.7.2 视图 5.7.3 模型 5.8 小结 第6章 插入、更新和删除数据 6.1 使用SQL INSERT插入数据 6.1.1 INSERT语句 ...
5.5 使用ALTER TABLE改变表 5.6 删除或取消表 5.7 创建基于Swing的表构建器 5.7.1 控制程序 5.7.2 视图 5.7.3 模型 5.8 小结 第6章 插入、更新和删除数据 6.1 使用SQL INSERT插入数据 6.1.1 INSERT语句 ...
5.5 使用ALTER TABLE改变表 5.6 删除或取消表 5.7 创建基于Swing的表构建器 5.7.1 控制程序 5.7.2 视图 5.7.3 模型 5.8 小结 第6章 插入、更新和删除数据 6.1 使用SQL INSERT插入数据 6.1.1 INSERT语句 ...
1.4.1 java.sql包中的类和接口及其使用 1.4.2 javax.sql包中所含内容及其使用 1.5 JDBC驱动程序简介 1.5.1 JDBC-ODBC 桥和ODBC驱动程序 1.5.2 本地API部分Java驱动程序 1.5.3 JDBC网络纯Java驱动程序 1.5.4 ...
MySQL的异常处理分析如下: 标准格式 DECLARE handler_type HANDLER FOR condition_value[,...] statement ... | SQLWARNING | NOT FOUND | SQLEXCEPTION | mysql_error_code condition_value细节 1、常用MYSQL E
Mysql 支持异常处理,通过定义 CONTINUE/EXIT 异常处理的 HANDLER 来捕获 SQLWARNING/NOT FOUND/SQLEXCEPTION (警告 / 无数据 / 其他异常)。其中, FOR 后面可以改为 SQLWARNING, NOT FOUND, SQLEXCEPTION 来指示...