免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2330 | 回复: 0
打印 上一主题 下一主题

birt如何使用jndi? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-12 15:40 |只看该作者 |倒序浏览

1. Install Your JDBC Driver Make an appropriate JDBC driver available to both Tomcat internal classes and to your web application. This is most easily accomplished by installing the driver's JAR file(s) into the $CATALINA_HOME/common/lib directory.
2. Declare Your Resource Requirements
In the webapps/WebViewerExample/WEB-INF/web.xml file, add the following entry to setup your JNDI service:
   
       Resource reference to a factory for java.sql.Connection
       jdbc/MySqlDB
       javax.sql.DataSource
       Container
   
where MySqlDB is your JNDI name.
3. Configure Tomcat's Resource Factory
配置数据源请参照
http://www.matrix.org.cn/thread.shtml?forumId=27&topicId=22207
To configure Tomcat's resource factory, add an element like this to the webapps/WebViewerExample/META-INF/context.xml file in the web application.
  
4. Set the JNDI property in your report to: java:comp/env/jdbc/MySqlDB


注意:1、开发阶段配置jdbc,直接链接数据库。
2、发布后,如果jdbc和jndi都配置了,会首先寻找jndi
What is the precedence when both JDBC URL and JNDI name are specified?
If your report design contains a JDBC data source defined with both JDBC Driver URL and JNDI name, then JNDI service will be used first and JDBC driver will be used as fallback. The username and password properties, if specified, are used in both cases. When you need to ensure that JNDI service is really used, increase logging level of BIRT engine; in case of JDBC fallback you will see JNDI lookup errors in the logs.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13625/showart_399384.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP