hibernate4.2.2使用schemaExport生成数据表报错,junit提示:SQLNestedException: Cannot create PoolableConnectionFact
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hibernate4.2.2使用schemaExport生成数据表报错,junit提示:SQLNestedException: Cannot create PoolableConnectionFact相关的知识,希望对你有一定的参考价值。
给mysql的root授权远程连接
1 mysql -u root –p 2 mysql>use mysql; 3 mysql>update user set host = ‘%‘ where user = ‘root‘; 4 mysql>select host, user from user;
hibernate.cfg.xml的内容
1 <property name="connection.username">root</property> 2 <property name="connection.password">0318</property>
junit的测试内容
1 ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure().build(); 2 3 MetadataImplementor metadataImplementor = (MetadataImplementor) 4 new MetadataSources(serviceRegistry).buildMetadata(); 5 6 SchemaExport export = new SchemaExport(serviceRegistry, metadataImplementor); 7 export.create(true, true);
以上是关于hibernate4.2.2使用schemaExport生成数据表报错,junit提示:SQLNestedException: Cannot create PoolableConnectionFact的主要内容,如果未能解决你的问题,请参考以下文章