How to set database connection on runtime in jasper studio dynamically

At run time how can we change the database ad deails?

tstuser's picture
Joined: Oct 21 2018 - 10:35pm
Last seen: 4 years 6 months ago

2 Answers:

No. Jaspersoft Studio does not support dynamic database connection.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago

I agree with Hozawa, that by default Jasper does not support dynamic connnections. but if you can write some scriptlets

Check Default Data adapters
When Default data adapter configuration is mentioned, the report will try to connect to a database using the configuration given in a default data adapter.
For configuring default data adapter on a report, you would write up a database config xml file and place that on the Root level of Jasper server
I'm just throwing an idea: 
May be you could write a scriptlet based on a parameter and update this default data adapter Configuration file on the server dynamically (but by no means this is secure since the configuration file carries unhashed username/password for the data adapter).

reportdev's picture
Joined: Oct 12 2015 - 12:05pm
Last seen: 1 year 3 months ago