在tomcat中搞数据源,配置jdni,部署项目的代码
0、apache-tomcat-6.0.32
1、在添加conf\Catalina\localhost\FXGL.xml部署应用,文件名影响应用名
<Context docBase="FXGL" path="/FXGL" reloadable="true"> <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@(description=(address=(protocol=tcp)(port=1521)(host=10.223.18.144))(connect_data=(service_name=EDW)))" username="username" password="password" maxActive="20" maxIdle="10" maxWait="-1"/> </Context>
2、在webapps文件夹中放入项目FXGL,不然docBase=“FXGL”就无效了。
3、在项目中用jndi数据源,与weblogic的不同,前面要添加“java:comp/env/”
<bean id="dataSourceCtl" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/TestDB</value> </property> </bean>
4、在最外面的目录中添加start.bat文件,方便别人演示项目,第二次写bat,水平低
cd %cd%\apache-tomcat-6.0.32\bin\ startup.bat
相关推荐
yangkang 2020-11-09
lbyd0 2020-11-17
sushuanglei 2020-11-12
85477104 2020-11-17
KANSYOUKYOU 2020-11-16
wushengyong 2020-10-28
lizhengjava 2020-11-13
星月情缘 2020-11-13
huangxiaoyun00 2020-11-13
luyong0 2020-11-08
腾讯soso团队 2020-11-06
Apsaravod 2020-11-05
PeterChangyb 2020-11-05
gaobudong 2020-11-04
wwwjun 2020-11-02
gyunwh 2020-11-02
EchoYY 2020-10-31
dingyahui 2020-10-30