IReport / Jasper Reports – Adding Glassfish Jasper Server Oracle Datasource
It is not that hard as it looks, really now
When adding a new datasource, Jasper Server always defaults to it’s preconfigured MySql driver and connection. Therefore, don’t be afraid when you see :
- Driver – com.mysql.jdbc.Driver
- URL – jdbc:mysql://localhost:3306/mydb
It does not mean it’s only meant to work with mysql, it’s just a default setting trying to give you a hint.
So, for adding an Oracle Datasource in Jasper Server, you would need to follow this simple steps:
- download the latest jdbc driver for Oracle – ojdbc6.jar
- Copy the file you just downloaded in your Glassfish domain , under /glassfish/domain/yourdomain/lib/ext folder
- Restart your Glassfish Server
- Now you are ready to add the datasource:
- Right click on datasources in the left menu – Add datasource
- Choose JDBC Resource
- Fill in the information to connect to your Oracle Server: Servername, SID, username and password
- Test your connection
- There you go!
This is how it should pretty much look like:
And by the way, Jasper Server 3.7.0 works just perfect with Glassfish 3. Just make sure that if you choose to create a new domain for your reporting server, you’d have to modify the name of the domain in install.xml file, and copy the mysql jdbc connector file in the same location as the one i have discussed above: /opt/glassfish/domains/yournewdomain/lib/ext
Cheers, time to go, it’s football time
Alex

Latest comments