Spring batch 如何在Spring批处理中使用Websphere数据源

Spring batch 如何在Spring批处理中使用Websphere数据源,spring-batch,Spring Batch,我需要在spring批处理中使用websphere数据源 我试着用 <bean id="wasdataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/testdb" /> <property name="lookupOnStartup" value="false" />

我需要在spring批处理中使用websphere数据源

我试着用

<bean id="wasdataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="jdbc/testdb" />
        <property name="lookupOnStartup" value="false" />
        <property name="cache" value="true" />
        <property name="proxyInterface" value="javax.sql.DataSource" />
</bean> 

SQL状态[null];错误代码[0];DSRA9110E:结果集已关闭。;嵌套异常为com.ibm.websphere.ce.cm.ObjectClosedException:DSRA9110E:ResultSet已关闭


指定的“targetDataSource”不是WebSphere WSDataSource:com.ibm.ws.rsadapter.jdbc。WSJdbcDataSource@4f68bc63


对不起,我的回答与WebSphere没有直接关系,但我们正在Jboss下成功地使用数据源。所以,既然你没有得到具体的答案,我想我可以帮助我的Jboss体验

我们对数据源的定义如下:

<jee:jndi-lookup id="sampleDS" jndi-name="java:jboss/datasources/sampleDS" expected-type="javax.sql.DataSource" lookup-on-startup="false" cache="true" />

而且效果很好

要使用
jee
标记,必须包含
xmlns:jee=”http://www.springframework.org/schema/jee“
转换为
声明和
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
进入
xsi:schemaLocation

希望能有帮助

问候,

鲍勃

<jee:jndi-lookup id="sampleDS" jndi-name="java:jboss/datasources/sampleDS" expected-type="javax.sql.DataSource" lookup-on-startup="false" cache="true" />