How to set database connection on runtime in jasper studio dynamically

0

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

tstuser's picture
Joined: Oct 21 2018 - 10:35pm
Last seen: 8 months 3 days ago

2 Answers:

0

No. Jaspersoft Studio does not support dynamic database connection.

hozawa's picture
52292
Joined: Apr 24 2010 - 4:31pm
Last seen: 5 months 4 days ago
0

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
1222
Joined: Oct 12 2015 - 12:05pm
Last seen: 3 months 5 days ago
Feedback
randomness