Symptom
How do I configure Websphere JNDI with Crystal Reports?
Environment
SAP Crystal Reports 2011
Resolution
- 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:
https://community.sap.com/t5/technology-q-a/creating-jndi-connection-through-websphere-crashes-after-selecting-oracle/qaq-p/9254195
Keywords
- JNDI
- JDBC
- Websphere
- IBM
- Crystal Reports
- CR
- DB2
Product
SAP Crystal Reports 2011