Use Oracle Database with JasperReports

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

JasperReports natively allows the use of OracleDB as main data source. If you ever wanted to use a more scalable database and professional for your JasperReports installation, here is how.

Step 1: Install JDBC drivers

If you haven’t installed the JDBC driver corresponding to the database server you want to connect, please follow the instructions to install the OracleDB driver.

Step 2: Add new data source

  • Log in to JasperReports.

  • Go to “Data Source > New Data Source”.

  • Select “JDBC Data Source” as the data source type.

  • Fill in the details of your database (username, password, hostname… etc.).

Step 3: Test the connection

  • Click on the “Test Connection” button. If everything was configured correctly, you should see a “Successful connection” message.

Step 4 (Optional): Disable MySQL

If you will not use MySQL as another data source, you can permanently disable it in the stack. This ensures it would not start and consume system resources. In order to do so, execute the commands below:

$ sudo installdir/ stop mysql
$ sudo sed -i '1i exit 0' installdir/mysql/scripts/
Last modification April 8, 2020