Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic Datasource
nicoleY
Hi i'm new to birt.
I have a question that is i wish to create a dynamic datasource means that i hope not to hardcode the jdbc url in the datasource setting.
as i'm afraid i will change to another database or server.
if really in this senario, i will need to change the setting in all reports i've created. this could be a problem if i have many reports.
What i'm thining is set a parameter in the url setting. so it will prompt user for the database url, then it can point to any database in this case.
is this possible or there is another way to achieve this purpose?
Thank you
Find more posts tagged with
Comments
johnrellis
Hey,
I achieved this by using the property binding function of the datasource. In the data explorer, right click your datasource and click edit. Now select property binding and enter something like this in the field designated "JDBC Driver URL" :
"jdbc:mysql://localhost/" + params["database_name"]
Where "database_name" is a report parameter.
To change the database server, try something like:
"jdbc:mysql://"+ params["database_server"]+"/database"
It also helps to assign a meaningful default value to the parameter when building the report, i find anyway.
Hope this helps,
John