四月13, 2017 2:41:11 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
四月 13, 2017 2:41:11 下午 org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.11.Final}
四月 13, 2017 2:41:11 下午 org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
四月 13, 2017 2:41:11 下午 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
四月 13, 2017 2:41:11 下午 org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
四月 13, 2017 2:41:11 下午 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
四月 13, 2017 2:41:12 下午 org.hibernate.cfg.Configuration addResource
INFO: HHH000221: Reading mappings from resource: com/cch/model/Student.hbm.xml
四月 13, 2017 2:41:12 下午 org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
四月13,2017 2:41:12 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)
四月 13, 2017 2:41:12 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/hibernate]
四月 13, 2017 2:41:12 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000046: Connection properties: {user=root, password=****}
四月 13, 2017 2:41:12 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
INFO: HHH000006: Autocommit mode: false
四月 13, 2017 2:41:12 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 1 (min=1)
四月 13, 2017 2:41:12 下午 org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
四月 13, 2017 2:41:12 下午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
四月 13, 2017 2:41:12 下午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
四月 13, 2017 2:41:13 下午 org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000227: Running hbm2ddl schema export
Hibernate:
drop table if exists Student
Hibernate:
drop table if exists _teacher
Hibernate:
create table Student (
id integer not null,
name varchar(255),
age integer,
primary key (id)
) type=InnoDB
Hibernate:
create table _teacher (
id integer not null,
name varchar(255),
title varchar(255),
primary key (id)
) type=InnoDB
四月 13, 2017 2:41:13 下午 org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: HHH000230: Schema export complete
Hibernate:
insert
into
_teacher
(name, title, id)
values
(?, ?, ?)
四月 13, 2017 2:41:13 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
INFO: HHH000030: Cleaning up connection pool [jdbc:mysql://localhost:3306/hibernate]
- hibernate默认用的slf4j
-
导入支持log4j的三个jar包
导入hibernate包里的lib目录下的optional下的encache下会找到slf4j-api.jar,然后根据这个版本去下载其他两个对应的jar包slf4j-log4j12.jar和log4j12.jar,注意版本的对应。
我的是:log4j-1.2.16.jar+slf4j-api-1.6.1.jar slf4j-log4j12-1.6.1.jar
下载链接:http://download.youkuaiyun.com/detail/hgg923/8435335
-
找到hibernate-release-4.3.11.Final\project\etc下的log4j.properties
拷进src下修改其中的配置就可以了
保留自己想看的,其它的用'#'注释掉
如:#log4j.logger.org.hibernate=debug
然后测试一下就可以了