mysql 自动创建表失败_mysql-SchemaExport export自动创建表失败

package entity;

import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.cfg.Configuration;

import org.hibernate.service.ServiceRegistry;

import org.hibernate.service.ServiceRegistryBuilder;

import org.hibernate.tool.hbm2ddl.SchemaExport;

import org.junit.Test;

public class TestStudents {

@Test

public void testSchemaExport()

{

//创建配置对象

Configuration config = new Configuration().configure();

//创建服务注册对象

ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry();

//创建sessionFactory

SessionFactory sessionFactory = config.buildSessionFactory(serviceRegistry);

//创建session对象

Session session = sessionFactory.getCurrentSession();

//创建SchemaExport对象

SchemaExport export = new SchemaExport(config);

export.create(true, true);

}

}

九月 20, 2015 2:40:45 上午 org.hibernate.annotations.common.Version

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

九月 20, 2015 2:40:46 上午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.4.Final}

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Environment

INFO: HHH000206: hibernate.properties not found

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Configuration configure

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

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Configuration getConfigurationInputStream

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

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Configuration addResource

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

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: entity/Users.hbm.xml

九月 20, 2015 2:40:46 上午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

九月 20, 2015 2:40:46 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

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

九月 20, 2015 2:40:46 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000115: Hibernate connection pool size: 20

九月 20, 2015 2:40:46 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

INFO: HHH000006: Autocommit mode: false

九月 20, 2015 2:40:46 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

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

九月 20, 2015 2:40:46 上午 org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

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

九月 20, 2015 2:40:46 上午 org.hibernate.engine.jdbc.internal.JdbcServicesImpl configure

WARN: HHH000342: Could not obtain connection to query metadata : Access denied for user 'root'@'localhost' (using password: NO)

九月 20, 2015 2:40:46 上午 org.hibernate.dialect.Dialect

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

九月 20, 2015 2:40:46 上午 org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation

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

九月 20, 2015 2:40:46 上午 org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService

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

九月 20, 2015 2:40:46 上午 org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory

INFO: HHH000397: Using ASTQueryTranslatorFactory

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值