Java / Oracle / Reporting / Graphs and Tables / JDBC

Posted on 2007-04-08
Last Modified: 2008-01-09
Hi everyone,

I am creating a simple Business Intelligence Tool in Java using Eclipse. I only need this tool to get some information off a desired database and then create some graphs and tables (reports).

I can connect to an oracle database and get all the information off of it. But now I need to create the reports. I was told to check some packages on this website :

I took a look at some of the possible packages and decided I would give JFreeChart a try. But the problem is I have no idea how to connect it to my Eclipse application.

I'm reaching the desperate point....

All I need is to create graphs and tables given some data which I get from a database....
Is there a simpler way to do this???

Please Help
Question by:RicardoVGomes
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 3

Expert Comment

ID: 18873263
Crystal Reports isn't free but it connects to Oracle seamlessly and creating charts and graph is very simple.  You can download a 90 day free trial of Crystal Reports to get started.  Just google crystal reports demo.  We call Crystal Reports directly from within our Web Apps.

Author Comment

ID: 18873473
So you mean that by incorporating Crystal Reports to my system, I could create a report with a click of a button on my application?

Say a user could choose two columns from a database in my application and crystal reports would just make a report(graph) say in jpeg?

Expert Comment

ID: 18873586
Crystal Reports (CR) connects directly to Oracle.  You then use CR to create your reports, graphs, charts, etc.,  it is very intuitive.  You can drag and drop Oracle columns onto your report and then have CR create charts and graphs from those column totals.  Reports can be run directly from CR or called  in several different ways including from a command line.  

We write Oracle based applications and then use CR as our reporting engine.  We use an oracle table to maintain the available reports.  Our reports user interface then list the available reports with the report name being linked to the report.  When a user is on a certain Oracle record within our application and clicks on the report name we pass the record key to CR when calling the report.  

This may be overkill for what you are doing but if you want the ability to create unlimited reports, charts and graphs from any oracle data and give your users a simple interface its hard to beat.  If you want to look at this further I can paste the java code we use to call the reports.
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users


Author Comment

ID: 18875086
I would need that code please.

And also if you could explain how to connect Crystal Reports to my eclipse project.


Expert Comment

ID: 18875328
You can probably try out BIRT. Eclipse 3.2 has ready-made plugins for BIRT and best of all, its open source.

Author Comment

ID: 18877344
I was thinking of using BIRT in the first place, being free and all...

Can someone explain how I would do this using BIRT????

Once again, all I want is : by clicking a button in my Eclipse project.... I want a report (graph/tables)... using columns from an Oracle database ( which I am already connected to in my project) .

Author Comment

ID: 18879527
I've been looking into BIRT.... and by what I understand... I can't do what I wanted...
creating reports from my project... and not from BIRT...

anyone have possible solutions?

please help, reaching desperate phase

Expert Comment

ID: 18879827
This is the main section of code we use for CR integration into our applications if you still want to look into using CR.

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="*"%>
<%@page import="com.grits.JRCHelperSample" %>
<%@page import="com.crystaldecisions.reports.sdk.ReportClientDocument" %>
<%@page import="" %>
<%@page import=""%>
<%@page import=""%>
try {
    String storedReportName = (String)session.getAttribute("reportName");
    String reportName = (request.getParameter("reportName") != null ? request.getParameter("reportName") : storedReportName);
    String storedParams = (String)session.getAttribute("params");
    String params = (request.getParameter("params") != null ? request.getParameter("params") : (storedParams == null ? "" : storedParams));
    boolean clearReport = (request.getParameter("clr") != null ? true : false);
    ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
    //CrystalReportViewer viewer  = (CrystalReportViewer) session.getAttribute("viewer");
    if (reportName == null) {
        reportName = storedReportName;
    if (clearReport || clientDoc == null || !reportName.equals(storedReportName) || !params.equals(storedParams)) {
        clientDoc = null;
        //viewer = null;
        // Report can be opened from the relative location specified in the CRConfig.xml, or the report location
        // tag can be removed to open the reports as Java resources or using an absolute path
        // (absolute path not recommended for Web applications).
        clientDoc = new ReportClientDocument();
        // Open report"Reports/" + reportName, OpenReportOptions._openAsReadOnly);
        // ****** BEGIN CHANGE DATASOURCE SNIPPET ****************  
        String connectString = "jdbc:oracle:thin:@";
        String driverName = "oracle.jdbc.driver.OracleDriver";
        String JNDIName = "jdbc/OSILASDS";
        String userName = "xxxxxxxxxx";
        String password = "yyyyyyyyy";
        // Switch all tables on the main report and sub reports
        JRCHelperSample.changeDataSource(clientDoc, userName, password, connectString, driverName, JNDIName);
        if (request.getParameter("params") != null) {
            JRCHelperSample.addReportParameters(clientDoc, "", request.getParameter("params"));
        // Store the report document in session
        session.setAttribute(reportName, clientDoc);
        session.setAttribute("reportName", reportName);
        session.setAttribute("params", params);
    // Create the CrystalReportViewer object
    CrystalReportViewer viewer = new CrystalReportViewer();

    //  set the reportsource property of the viewer
    IReportSource reportSource = clientDoc.getReportSource();              
    // Process the report
    viewer.processHttpRequest(request, response, application, pageContext.getOut());
catch (ReportSDKExceptionBase e) {

Author Comment

ID: 18881407
I took a look, and there is only a 30 day free trial, I would need it for at least 60. But thanks for your help.

I'm thinking BIRT is a possibility. Can anyone help with BIRT?


Accepted Solution

n_sachin1 earned 500 total points
ID: 18881641
  Here are some links that can guide you on using BIRT. Are you on Eclipse 3.2 ? If yes, there is a BIRT report designer perspective that you can use to design the reports. Details are present at:

You can use the BIRT report engine for integration with your java application and bind data to previously designed reports programmatically.



Author Comment

ID: 18882993
You can use the BIRT report engine for integration with your java application and bind data to previously designed reports programmatically.

Can you explain how I can do this? step by step ?


Expert Comment

ID: 18887489
Ricardo, look at the links provided above. There is a step by step process definition to achieve this, with examples.

Author Comment

ID: 18889160
Thanks n_sachin1,

I have downloaded and extracted it.

I have added the iText1.3.jar file into the apropriate plugin directory.

Configuring JDBC drivers.......
Now it asks me to put the driver jar file into a certain directory.... what is this jar file and where do I find it? I can already connect to a database using jdbc_odbc.


Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question