Is there a (good) way in SmartGWT to parametrize the schema that the datasource's sql statement will use? Specifically, I am using a MySQL database that has multiple databases, eg "db_client1", "db_client2", "db_client3", each of which is identical in structure. In my datasources, 90% of my queries are partially custom queries. I'd like the table names in the final sql statements to be prefixed with the schema name. So, instead of
select bar from foo1, foo2
where foo1.pk=foo2.fk
it should read
select bar from db_client1.foo1, db_client1.foo2
where db_client1.foo1.pk=db_client1.foo2.fk
All this said, I'm very open to other, cleaner suggestions of getting the datasource to point to a different schema. Currently, the server.properties file's parameter "sql.Infini.driver.name" is set to use an Apache Tomcat JDBC pool, so my best idea was to parameterize the datasource's tables names. But, if there was a way that just prior to every sql statement, SmartGWT would execute some sort of "use db_client1" statement, that might be best (since it would involve the least change to all my code.)
Additional details:
======================
SmartGWT (not smartclient) Version: SmartClient Version: v8.3p_2012-11-26/PowerEdition Deployment (built 2012-11-26)
...
Browser: Mozilla Firefox ESR 10.0.7
GWT SDK: 2.5.0rc2
Sun JDK 1.6.0_13
OS: Centos 6.x
IDE: MyEclipse 10.6 with Google Plugin for Eclipse (3.1.0)
select bar from foo1, foo2
where foo1.pk=foo2.fk
it should read
select bar from db_client1.foo1, db_client1.foo2
where db_client1.foo1.pk=db_client1.foo2.fk
All this said, I'm very open to other, cleaner suggestions of getting the datasource to point to a different schema. Currently, the server.properties file's parameter "sql.Infini.driver.name" is set to use an Apache Tomcat JDBC pool, so my best idea was to parameterize the datasource's tables names. But, if there was a way that just prior to every sql statement, SmartGWT would execute some sort of "use db_client1" statement, that might be best (since it would involve the least change to all my code.)
Additional details:
======================
SmartGWT (not smartclient) Version: SmartClient Version: v8.3p_2012-11-26/PowerEdition Deployment (built 2012-11-26)
...
Browser: Mozilla Firefox ESR 10.0.7
GWT SDK: 2.5.0rc2
Sun JDK 1.6.0_13
OS: Centos 6.x
IDE: MyEclipse 10.6 with Google Plugin for Eclipse (3.1.0)
Comment