You could look at the database metadata through the Connection:

    sqlMapClient.getCurrentConnection().getMetaData().getDatabaseXXX()

And then use that to call either the Oracle or generic sql.

I personally wouldn't go that route because Oracle might change their
metadata so it'd break your code.

I'd probably go with some kind of application config that's defined along
with the DataSource (JNDI, Spring, properties file, whatever):

database.vendor=Oracle

And then specifically look for that in my code.

On 6/18/08 9:25 AM, "Julio Faerman" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I would like to know if is it possible to check if a query exists
> before executing it.
> For example, if i am using oracle and have a optimezed query for
> oracle, i would like to run:
> 
> sqlMapClient.queryForList("myQuery.oracle");
> 
> if there is no special query for oracle, i would like to run just the
> standard query:
> 
> sqlMapClient.queryForList("myQuery");
> 
> is it possible to do something like "sqlMapClient.exists/contais(query)" ?
> 
> Thank you,
> Julio

Reply via email to