Spring整合JNDI数据源配置 - Go语言中文社区

Spring整合JNDI数据源配置


1、Spring数据源Datasource配置??.xml文件

   <util:properties id="contextProperties" location="classpath:context.properties"/>

   <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="#{contextProperties['common.dataSource.jndiName']}"/>
		<property name="resourceRef"  value="true"/>
  	</bean>

2、context.properties配置信息

common.dataSource.jndiName=PRTPLM
common.dataSource.jndiName.real=PRTPLM

3、Tomcat下的context.xml文件配置

<Resource name="PRTMAP" auth="Container"
	              type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
	              url="jdbc:oracle:thin:@109.116.6.102:1521:DEVGMAP"
	              username="GMAPPRT" password="gmapprt01$" maxActive="20" maxIdle="10" maxWait= "-1"/>

4、Tomcat下的web.xml文件配置

	 <resource-ref>
	  <description>PRTMAP DataSource</description>
	  <res-ref-name>PRTMAP</res-ref-name>
	  <res-type>javax.sql.DataSource</res-type>
	  <res-auth>Container</res-auth>
	 </resource-ref>

 

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/zst555/article/details/85157457
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2021-06-27 01:06:57
  • 阅读 ( 466 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢