"Current" schema and Oracle Connection

Hi all !

Is it possible to get the current schema name for an Oracle connection ?

We don't want to execute a query but we want to use the DatabaseMetadata if it is possible... or another stuff like this...

Moreover, something like createStatement().executeQuery("SELECT 'FOO' FROM DUAL").getMetaData().getSchemaName(1)

returns an empty string.

This Oracle connection is retrieved from a JNDI resource so that its schema is not known... And the schema name is needed to use another tool.

Thanks you very much in advance for your help,

St閜hane.

[620 byte] By [crasniera] at [2007-11-27 5:55:57]
# 1
Oracle specific:select sys_context('USERENV', 'CURRENT_SCHEMA') CURRENT_SCHEMA from dual;
aniseeda at 2007-7-12 16:25:29 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Thanks for your help !So, there is no way to get the "current" name thanks to the JDBC API without executing a request ?Indeed, we would want to be generic instead of being database-specific...St閜hane.
crasniera at 2007-7-12 16:25:29 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...