hibernate4+proxool问题

yushihai 2015-08-18 08:20:00
hibernate新手,项目使用JDBC连接时一切正常,但使用Proxool连接池时就会出现错误。错误提示是:java.sql.SQLException: The url cannot be null
proxool.xml代码如下:
<?xml version="1.0" encoding="utf-8"?>
<!-- the proxool configuration can be embedded within your own application's.
Anything outside the "proxool" tag is ignored. -->
<something-else-entirely>
<proxool>
<alias>DBPool</alias>
<driver-url>jdbc:mysql://localhost:3306/djb?characterEncoding=utf-8</driver-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver-properties>
<property name="user" value="root"/>
<property name="password" value="root"/>
</driver-properties>
<house-keeping-sleep-time>90000</house-keeping-sleep-time>
<maximum-new-connections>20</maximum-new-connections>
<prototype-count>5</prototype-count>
<maximum-connection-count>100</maximum-connection-count>
<minimum-connection-count>10</minimum-connection-count>
<house-keeping-test-sql>
select CURRENT_DATE
</house-keeping-test-sql>
</proxool>
</something-else-entirely>

hibernate.cfg.xml相关配置如下:
	<!-- 配置proxool数据源 -->
<property name="hibernate.connection.provider_class">
<!-- org.hibernate.connection.ProxoolConnectionProvider -->
org.hibernate.service.jdbc.connections.internal.ProxoolConnectionProvider
</property>
<property name="proxool.pool_alias">DBPool</property>
<property name="proxool.xml">WEB-INF/Proxool.xml</property>
<!--<property name="proxool.properties">Proxool.properties</property>-->
<property name="proxool.existing_pool">true</property>
<!-- 是否在控制台打印SQL -->
<property name="show_sql">true</property>
<!-- 格式化SQL -->
<property name="format_sql">true</property>
<!-- 指定自动生成数据表策略 -->
<property name="hibernate.hbm2ddl.auto">update</property>
...全文
141 点赞 收藏 回复
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-08-18 08:20
社区公告
暂无公告