birt一点一滴系列之用jndi方式配置t数据源
1、在tomcat目录\conf\context.xml文件中加入配置
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
auth="Container"
name="jdbc/testDB"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="10"
maxWait="1000"
driverClassName="oracle.jdbc.driver.OracleDriver"
username="sa"
password="sa"
url="jdbc:oracle:thin:@192.168.0.1:1521:test"
maxActive="10"/>
</Context>
2.在web.xml中加入配置
<resource-ref>
<description>Database Source</description>
<res-ref-name>jdbc/testDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3.把数据库驱动加载到tomcat和应用的lib目录下
4.在birt的Data Source中配置jndi名称即可