Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 159 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 471 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
How to programatically change schema name for an application ? JDev10g

583757
Member Posts: 34
I am using JDeveloper 10g 10.1.3.4
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 http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
and http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.htmlexample 14.*[Dynamic JDBC Credentials for Model 1 and Model 2|http://otn.oracle.com/products/jdev/tips/muench/dynamiccredentials/DynamicCredentials1013.zip]* [10.1.3.3] 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.
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 http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
and http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.htmlexample 14.*[Dynamic JDBC Credentials for Model 1 and Model 2|http://otn.oracle.com/products/jdev/tips/muench/dynamiccredentials/DynamicCredentials1013.zip]* [10.1.3.3] 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.
Answers
-
Hi,
I am not sure if JDBC really supports this. I found
386043
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
Frank
This discussion has been closed.