1、SpringJNDI数据源配置信息:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/SSOPool</value>
</property>
</bean>
红色部分是tomcat或者其他应用服务器配置的JNDI.
2、关于JNDI的配置(tomcat):
修改tomcat目录conf/context.xml文件:
<Resource name="SSOPool" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" username="zy"
password="zy" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.1.201:1521:ORCL"/>
3、通过JNDI获取DataSource:
Context context = new InitialContext();
DataSource ds = (DataSource)context.lookup("java:comp/env/SSOPool ");
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/SSOPool</value>
</property>
</bean>
红色部分是tomcat或者其他应用服务器配置的JNDI.
2、关于JNDI的配置(tomcat):
修改tomcat目录conf/context.xml文件:
<Resource name="SSOPool" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000" username="zy"
password="zy" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.1.201:1521:ORCL"/>
3、通过JNDI获取DataSource:
Context context = new InitialContext();
DataSource ds = (DataSource)context.lookup("java:comp/env/SSOPool ");