既然用websphere的连接池,你在webspere中的配置和hibernate.properties(hibernate.cfg.xml)中的配置是否吻合?
解决方案 »
- String.formak里面的%s,%d怎么用的?求解!
- hibernate 级联
- struts2 list值的转换问题
- 有关jdom中element为ROOT的处理方法
- webservices 客户端怎么用jaxb解析得到的xml?
- 请问一个数据库查询的问题
- 急!jsp页面如何自动加载数据?最好有简单详细的例子。在线等!
- 关于java -jar 的使用(能不能在java -jar 的.jar文件中存在一些lib的jar?)
- 谁有XML SPY5.0的注册号!!!
- idea Springboot 开发的https 接口无法访问,错误信息:[Fiddler] ReadResponse() failed: The server
- 熟悉Sun 的J2EE Application Server的看过来
- 我的JDBC死活配不上
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration>
<session-factory name="foo">
<mapping resource="struts/advinfo/db/Advisor.hbm.xml"/>
<mapping resource="sys/bm/Duty.hbm.xml"/>
<mapping resource="struts/message/bo/Accessories.hbm.xml"/>
<mapping resource="struts/message/bo/Body.hbm.xml"/>
<mapping resource="struts/message/bo/Send.hbm.xml"/>
<mapping resource="struts/cet/bo/Cet.hbm.xml"/>
</session-factory>
</hibernate-configuration>
hibernate.cfg.xml文件中要这样配置吧!这是tomcat中这样配,不知道websphere文件中jndi目录是否是
java:comp/env?
看你用哪种方式产生Configuration,如果用Configuration c=new Configuration()则默认是hibernage.properties文件,那么就在这里面配置.
如果用其它方式产生Configuration就在hibernate.cfg.xml文件中配置!
不过也怪,部署到服务器上面有时候又能连接到数据库。
An alternative approach to configuration is to specify a full configuration in a file named hibernate.cfg.xml. This file can be used as a replacement for the hibernate.properties file or, if both are present, to override properties.