I've seen this discussed a couple of times here.
We have a scenario, or usage pattern, with Oracle that would benefit from iBATIS somehow being able to specify a schema name as a parameter/property.
If we have an application XXX, we commonly use several schemas/users:
XXXOWNER creates and owns the objects
XXXUSER is used by application servers to query and update objects
XXXREADER is used for read-only access, for example by users running reports
The idea is that only XXXOWNER has DDL privileges; so XXXUSER capabilities are limited. Perhaps this is not terribly useful as a security feature per-se.
But, we do find it kind of nice for separation of duties -- the DBA team are responsible for all DDL in production, and they have the XXXOWNER schema/password. The development/support team deploy applications on to application servers, including configuration of DataSources, and they have the XXXUSER schema/password.
We use a bit of Hibernate and a bit of iBATIS. Hibernate does allow you to configure the schema as a property. iBATIS doesn't. Our current solution with iBATIS is to define PUBLIC SYNONYMs for XXXOWNER objects, so they can be accessed from other schemas without qualification. I would prefer to qualify them as we do with Hibernate.
But, I'm not sure how this would work with iBATIS. I certainly don't want to change or break the way parameters are currently provided to statements -- and I don't want to put the schema as a property into my beans!
Food for thought I guess ...
Regards
John Hurst
Wellington, New Zealand
On 3/12/06, Larry Meadors <[EMAIL PROTECTED]> wrote:
No, there really isn't anything like this in iBATIS, because we try
(as much as possible) to not mess with the SQL that you write.
What database are you using?
Many allow you to specify a default schema on the connection string,
or connect as the schema owner.
Larry
On 3/11/06, Gianluca Gaiotto < [EMAIL PROTECTED]> wrote:
> Ciao,
> can I specify the database schema in sqlMap, or elsewhere, but in a
> declarative way (without hard-coding it)?
> The problem is that we have several environments stages (dev,
> integration, test, production) , and therefore I have to configure the
> right schema for each environment... And I don't want to add the schema
> name prefix in front of each table name, but configuring a default db
> schema somewhere in an iBatis config file (and to have several config
> files, one for each environments).
>
> Thanks
> -Gianluca
>
>
>
