0
在weblogic 10.3.6服务器中,我定义了as400数据源,现在我使用myEclipse和java spring框架开发程序,以使用namedParameterjdbctemplate访问as400 db。我有用于as400 select语句的sql。我在我的项目中的applicationContext.xml中定义了下面的xml代码。有没有办法使用jdbcParameterNamedTemplate函数,因为我知道jdbcTemplate需要具有连接字符串或密码的数据源,我不想在代码中输入这些值,但仍然使用weblogic数据源?有没有例子?myEclipse namedParameterJDBCTemplate访问weblogic数据源
<beans>
<bean id="AS400UATJdbcTemplate" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="AS400UAT"/>
<property name="lookupOnStartup" value="false"/>
<property name="cache" value="true"/>
<property name="proxyInterface" value="javax.sql.DataSource"/>
</bean>
<bean id="getCreditCardByAccountsNumeStoredProcedure" class="com.as400function.GetAccountsByTypeStoredProcedure" singleton="false">
<constructor-arg>
<ref bean="AS400UATJdbcTemplate"/>
</constructor-arg>
</bean>
<bean id="AddSingleWithCreditCard" class="com.as400function.AddSingleWithCreditCard" singleton="false">
<constructor-arg>
<ref bean="AS400UATJdbcTemplate"/>
</constructor-arg>
</bean>
</beans>
它解决了以下回答 – Chiu