【发布时间】:2013-01-20 06:59:16
【问题描述】:
我使用 Hibernate 4、Spring 3、JSF 2.0 和 Weblogic 10.3.6 作为服务器。
我在 Weblogic 服务器上创建了数据源,在 applicationContext.xml 中我将数据源定义为
<!-- Data Source Declaration -->
<bean id="DataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/myDS"/>
</bean>
如果我想使用 P6Spy 来记录 SQL 参数,我应该如何以及在何处在 applicationcontext.xml 中添加以下内容?
<property name="hibernate.connection.driver_class">com.p6spy.engine.spy.
P6SpyDriver</property>
任何帮助都是非常值得赞赏的。
谢谢
【问题讨论】:
-
官方文档有帮助吗? p6spy.github.io/p6spy/install.html Websphere 版本可能已经过时,但信息可能仍然相关。
-
@PeterButkovic Websphere 中提到的任何东西都应该在 Websphere 应用服务器中配置,不是吗?
-
我猜,我错过了你的意思。你的意思是?从我的角度来看,您需要做的就是创建新的数据源(p6spy 之一),该数据源稍后将代理真实的数据源(jdbc/myDS)。而 applicationcontext.xml 只会引用 p6spy 之一。我猜应该是这样。
标签: java spring hibernate logging p6spy