Configure JNDI

step1:Install JDBC Driver
    copy the jdbc driver jar file used by JNDI Data Source service into the <Tomcat_Home>/common/lib folder.

step2: Declare Resource Requirements
    In the webapps/xxxxx/WEB-INF/web.xml file, add the following entry to setup JNDI service:

    <resource-ref>

        <description>Resource reference to a factory for java.sql.Connection</description>
<res-ref-name>jdbc/JNDI_NAME</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

step3: Configure Tomcat's Resource Factory
    In the webapps/xxxx/META-INF/context.xml file, add a resource entry to setup JNDI data source factory:. (configuring this in <Tomcat_Home>/conf/context.xml would apply to all web applications)

    <resoucelink>

step4: add to server.xml file in $CATALINA_HOME/conf

 <Resource  auth="Container" name="jdbc/JNDI_NAME" type="javax.sql.DataSource"
    password="password"
    driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
    maxIdle="2"
    maxWait="5000"
    validationQuery="select 1"
    username="sa"
    url="jdbc:sqlserver://server;databaseName=property"
    maxActive="4"/>

step5:  In report data source, specifie the JNDI URL as java:comp/env/jdbc/JNDI_NAME

Refence:

1.http://dev.eclipse.org/newslists/news.eclipse.birt/msg11346.html

2.https://bugs.eclipse.org/bugs/show_bug.cgi?id=131662#c7

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值