I would like to know how to open a database connection using the Proxy users in Eclipse link Entity manager.
We have ‘n’ number of database users created in our oracle database and the necessary access rights and roles have been given to these users to access the data from the main schema where the data is stored.
Each user is using a separate user name and password for logging in to Eclipse application which connects to the database via eclipselink entity manager using user specific login information.
We would like to avoid getting the user name and password from user each time.
Instead we would like to create a connection to the database user using the proxy user(Feature of
Suppose a user TEST1 wants to connect to database. Now we have granted the option for Test1 to connect through to test2 as shown below.
Conn / as sysdba
SQL >alter user TEST1 grant connect through TEST2;
SQL >conn TEST2[TEST1]
Enter password:< Give password for TEST2>
SQL >show user
USER is "TEST1"
SQL >create table emp_test as select * from emp;
SQL > conn / as sysdba
SQL > select owner from dba_tables where table_name='EMP_TEST';
We were able to create an object in Test1 without knowing the password of Test1. By using the proxy user Test2 with the necessary privileges.
Is it possible to connect to database using eclipselink as user test1 via the proxy user Test2 (Without knowing the password of Test1).