context.xml 文件 <Resource name="spring/sjpt" auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="20" maxIdle="10" maxWait="10000" password="spsj" type="javax.sql.DataSource" url="jdbc:oracle:thin:@172.30.114.44:1521:spsj" username="spsj"/> 使用: torque.properties torque.database.default=ups torque.database.ups.adapter=oracle torque.dsfactory.ups.factory=org.apache.torque.dsfactory.JndiDataSourceFactory torque.dsfactory.ups.jndi.path=java:comp/env/spring/sjpt log4j.xml <appender name="db" class="com.Appender"> <param name="jndiDataSource" value="java:comp/env/spring/sjpt" /> jdbc.properties jndi.name=java:comp/env/spring/sjpt