Crystal Reports for Eclipse Developer Guide

Reporting off JDBC and JNDI Data Sources

Crystal Reports Java makes use of the Java Naming and Directory Interface (JNDI) to establish connections to data sources that are specified in the report. Once the connection information has been retrieved from the JNDI server, Crystal Reports Java uses the information to establish a JDBC connection to the data source.

Note: If your report is designed against a JDBC data source using the JDBC driver for Crystal Reports, your report already contains the information it needs to natively connect to the JDBC database. In this case, you do not need to perform any of the configuration steps outlined in this section. You do, however, need to ensure that the appropriate driver files are available to your web application in order to connect to the JDBC data source.
To ensure that Crystal Reports Java can successfully establish a connection when retrieving report data, the JNDI entries for the required data sources must be correctly configured. For more information on how to configure a JNDI data source entry, consult the documentation for your application server and JDBC driver.
To establish a connection, Crystal Reports Java retrieves the data source name from a Crystal report and performs a JNDI lookup for the corresponding JDBC data source information. Therefore, it is important to use the exact data source name that is used in the Crystal report. To view the data source name, open the report in the Crystal report designer and use the Database Explorer to display the data source name.
To define a JDBC data source, the recommended method is to register a JDBC data source with the application server's naming service. The methods for registering JDBC data sources are specific to the application server. Refer to the application server's documentation for more information.