hibernate测试的时候出错Not binding factory to JNDI, no JNDI name configured

来源:百度知道 编辑:UC知道 时间:2024/06/27 07:22:24
[INFO ][2009-10-19 14:36:22] configuring from resource: /hibernate.cfg.xml
[INFO ][2009-10-19 14:36:22] Configuration resource: /hibernate.cfg.xml
[INFO ][2009-10-19 14:36:22] Reading mappings from resource: com/demo/hibernate/beans/User.hbm.xml
[INFO ][2009-10-19 14:36:22] Mapping class: com.demo.hibernate.beans.User -> user
[INFO ][2009-10-19 14:36:22] Configured SessionFactory: null
[INFO ][2009-10-19 14:36:23] Using Hibernate built-in connection pool (not for production use!)
[INFO ][2009-10-19 14:36:23] Hibernate connection pool size: 20
[INFO ][2009-10-19 14:36:23] autocommit mode: false
[INFO ][2009-10-19 14:36:23] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/demo
[INFO ][2009-10-19 14:36:23] connection properties: {user=root, password=****}
[INFO ][2009-10-19 14:36:23] RDBMS: MySQL, version: 5.1.35-community
[INFO ][2009-10-19 14:36:23] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-jav

那个不是错误信息,是提示信息,前面提示的是INFO.
只是提示你没有使用JNDI数据源来建立连接,而是使用的普通JDBC来建立连接.

你这是在用hibernate生成factory的时候在Configuration里面Propertites没有设置format-true Show-true