Dynamic database adaption [message #1696137] |
Fri, 22 May 2015 09:55 |
Stefan Seitz Messages: 14 Registered: February 2015 |
Junior Member |
|
|
Here is what I want to do:
For my application, I have to support three different databases: MS SQL, PostgreSQL and Oracle.
I am using Connection Profiles and externalized properties for my Data Source.
Depending on the database, I have to dynamically adjust the queries.
All this works fine as long, as I use a report parameter to switch between the databases.
What I want to do is, to detect the used database from what is in the connection profile (e.g. by reading "odaConnectionProfile" setting).
I tried reading the property in Data Source -> Before Open Script.
driverClass = String(this.getExtensionProperty("odaDriverClass"));
switch(driverClass){
case "org.postgresql.Driver":
myDatasource = "postgresql";
break;
case "net.sourceforge.jtds.jdbc.Driver":
myDatasource = "ms_sql";
break;
case "com.actuate.jdbc.oracle.OracleDriver":
myDatasource = "oracle";
break;
}
Problem is that the result I get here is always the result from what is saved in the Report Design and not what is in the connection profile.
How could I access what is in the connection profile?
Thanks for your help in advance.
|
|
|
Powered by
FUDForum. Page generated in 0.02934 seconds