数据源::本机MySQL中的数据库 test; 服务器:apache-tomcat-6.0.35; 1、先在Eclipse中建立一个Web项目, 我的叫Report。然后在Report项目上集成报表。 2、在\apache-tomcat-6.0.35\conf\Catalina\localhost中,建立名为MyReportJNDI.xml的文件,在其中指明项目路径和数据源配置,内容如下: xml 代码: - <Context path="/Report" docBase="D:/java/Report" debug="99" reloadable="true">
- <Resource name="mysql/test" type="javax.sql.DataSource"
- driverClassName="com.mysql.jdbc.Driver" maxIdle="30" maxWait="10000"
- sername="root" password="root"
- url="jdbc:mysql://localhost:3306/test"
- maxActive="100"/>
- </Context>
复制代码
|