老大,我想知道如何在hibernate.cfg.xml中配置使用其他的连接池如proxool或c3po?
解决方案 »
- java如何获取服务器的当前时间----------------
- 各位,这是什么错误??
- 一个关于JSP中循环的问题
- IntelliJ IDEA 8.1.2中如何部署项目?
- struts1中页面之间迁移时 历史页面数据的保存
- lucene索引更新的问题
- 关于在jdeveloper发布的webservice在Jboss中运行的问题。
- 请教dhtmlx tabbar刷新问题
- 请问java程序中调用其他的java编译类吗?在线!搞了几天拉!
- 求教WEBLOGIC6.1连SQLSERVER2000的配置,和在哪里有下载WEBLOGIC-SQLSERVER2000的驱动
- 请各位提供一本好的STRUTS书
- 请问tomcat是否支持php脚本呀???
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<description> Simple Register</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/userDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref></web-app>
hibernate.cfg.xml:
<property name="hibernate.connection.datasource">java:comp/env/jdbc/userDB</property>
<description> Simple Register</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/userDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
连接池的JNDI名是jdbc/userDB调用连接池
java:comp/env/jdbc/userDB是连接池的全名
<property name="hibernate.connection.datasource">java:comp/env/jdbc/userDB</property>