Avatar of Luke Eason
Luke Eason
Flag for United States of America asked on

JSP Crystal Reports XI JNDI


I am trying to display crystal  reports  in a jsp (Java ee) web portal . I don't have much experience with Crystall reports however I've installed Crystal Reports plugin for eclipse from the following link. We are using-
eclipse plugin:  http://downloads.businessobjects.com/akdlm/crystalreportsforeclipse/2_0/update_site/
Crystal reports XI,  
Database:DB2  i5/0S (AS/400),
the web project I want reports to display is on tomcat7
We also have a websphere dedicated to crystal reports.

Open in new window

Just for sake of testing, I went to eclipse > new > Crystal Reports Web Project. It created the project  and  few sample rpt files (screen shot attached).

I added a report that we created and tried to run the jsp file and I got following error:

Error finding JNDI name (DBCON)  

DBCON is the name of the ODBC connection we created while creating the report in crystal report professional (software).  

Any effort to help will be more than appreciated. Thank you

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %>
<%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>

<crviewer:viewer reportSourceType="reportingComponent" viewerName="CrystalReport1-viewer" reportSourceVar="CrystalReport1" isOwnPage="true">
	<crviewer:report reportName="MYREPORT.rpt" />

Open in new window

DB2Web ServersJSP

Avatar of undefined
Last Comment

8/22/2022 - Mon

I'm not too familiar with BO, but I have a feeling that in this case, in a Java-based environment, you should be using JDBC connectivity, not ODBC. Just a guess - you may need to configure a JNDI datasource in Tomcat with the same name.
Luke Eason

Thanks for the response  Mustaccio.

Yes I understand that I am suppose to use JDBC/JNDI. I know how JDBC works. I have never configured JNDI datasource before, if you can help me with that, it will be great.

Start here: http://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html

You will need to download the DB2 JDBC driver package from here: https://www-304.ibm.com/support/docview.wss?uid=swg27016878

The .jar files to add to the Tomcat CLASSPATH are db2jcc.jar and db2jcc_license_cisuz.jar. The driver class name is com.ibm.db2.jcc.DB2Driver. The URL format would be jdbc:db2//hostname:port/databasename
Your help has saved me hundreds of hours of internet surfing.
Luke Eason

I already have jdbc drivers and all that. I have worked with JDBC stuff... just JNDI is new to me.  Thanks for the quick response. I will have give it a shot and let you know.

Thanks once again.
Luke Eason

Mustaccio,  tell me if I understand this right.

Setting up JNDI data source is just configuring context.xml file in META-INF folder and adding jar files (drivers) in tomcat ? Is that all?


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question