How to configure Oracle to use a schema name different than the login user in JBoss EAP

Solution Verified - Updated -

Issue

  • How to configure Oracle to use a schema name different than the login user.
  • We are connecting to an Oracle DB. We are trying to configure the JDBC settings to use a schema different than the login user. We attempted to set up a new SQL connection using the new-connection-sql property as shown below, but it did not work.
<datasource jndi-name="java:jboss/datasources/MyDS" pool-name="MyDS" enabled="true">
                    <connection-url>****</connection-url>
                    <driver>oracle</driver>
                    <security>
                        <user-name>****</user-name>
                        <password>****</password>
                    </security>
                    <new-connection-sql>ALTER SESSION SET CURRENT_SCHEMA=${...}</new-connection-sql>
                </datasource>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.4.18

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In