How do I configure Websphere JNDI with Crystal Reports?
SAP Crystal Reports 2011
- Open CRConfig.xml in C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java
- Inside the <DataDriverCommon> tag edit the <Classpath> tag and add the path of your jdbc and websphere jars
- Inside the <JDBC> tag edit the following tags in addition to <JDBCURL>, <JDBCClassName>, <JDBCUserName>
- The <JNDIURL> tag should reference your JNDI server such as <JNDIURL>iiop://myhost.mycompany.com:2809</JNDIURL>
- The <JNDIConnectionFactory> tag should reference the driver that your web application server uses to create its JNDI connections such as <JNDIConnectionFactory>com.ibm.websphere.naming.WsnInitialContextFactory</JNDIConnectionFactory> From my reading this should be located in ws_runtime.jar
- The <JNDIInitContext> tag should reference the proper context for your web application such as <JNDIInitContext>/</JNDIInitContext>
- The <JNDIUserName> tag should reference your websphere app server user such as <JNDIUserName>system</JNDIUserName>
- Open Crystal reports designer and when you create a new connection, choose JDBC / JNDI
- In the pop-up choose JNDI (you will see the values for Provider URL, username and context as how you specified in the CRConfig.xml file). Specify the password for websphere user
- Hit next and it should show you the available jndi
- Choose a JNDI and create the report
Some background reading from IBM that may be useful:
Some related articles on our SAP Community Network that may be useful. The second is a bit dated so it refers to javaserver.ini instead of the current crconfig.xml, however, the directions are applicable if you substitute javaserver.ini with crconfig.xml.
- Crystal Reports