Forum Stats

  • 3,839,402 Users
  • 2,262,488 Discussions


How to programatically change schema name for an application ? JDev10g

583757 Member Posts: 34
edited Oct 17, 2008 2:58AM in JDeveloper and ADF
I am using JDeveloper 10g
What I am trying to do is: while connecting to the database instace with login/passwd credentials for a specific schema, being able to take in
schema as a separate paramter and connect to that schema.
Connecting to a database instace ORCL to the hr schema say with hr/hr
supply a paramter schema_name: scott. and connect to the scott schema as the hr schema user.

In SQL Plus* all you do is
connect as hr/hr
and then
alter session set current_schema = scott.

While developing an application that autheticates against database username/pwd credentials I was using the methodology
as described on
and 14.*[Dynamic JDBC Credentials for Model 1 and Model 2|]* [] 2006, Upd: 17-MAY-2007 by Steve Muench

In the DynamicJDBCBindingFilter that in the doFilter() method, I was trying to find a way to be able to specify the schema name
as in sessoion.setAttribute(Configuration.<SomeProperty>, schema);
is there any property/parameter that can be set to change the schema within the context of the application?
because in all the code that i see there are attributes of 'Configuration' that are being set.
So I don't think there is way for me to just write straight up jdbc code to
create a connection and run the statement "alter session set current_schema = scott"
and be able to pass the login credentials
and connect to the schema I want to.
Any help would be appreciated.


  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge

    I am not sure if JDBC really supports this. I found


    but this never got a success/failure statement.

    If you want to use a singe connection but different schema for users then you may want to have a look at proxy user authentication, which is exatly doing what you want - use a single user to get into the database and then have him mapped to his own schema to work in

This discussion has been closed.