At times it may be necessary to grant access to a database schema but not necessarily give the password for the login. Granting connect through comes useful in such cases. Below example demonstrate the usage. Assume user appadmin is the main application user and appguest user whom access to appadmin schema will be granted.
For JDBC proxy connections refer the following metalink notes.
How to use Proxy Users to connect to a Database using Credential Mapping or User Injection. [1529978.1]
How to Ensure USER Session Variable Accurately Reflects "real" User When Using Proxy Authentication with JDBC [431202.1]
SQL> create user appadmin identified by appadmin;Grant appguest connect through as appadmin
User created.
SQL> create user appguest identified by appguest;
User created.
SQL> grant connect to appadmin;
Grant succeeded.
SQL> grant connect to appguest;
Grant succeeded.
SQL> alter user appadmin grant connect through appguest;With this command user appguest would be able to connect to appadmin without specifiying appadmin password.
User altered.
SQL> conn appguest[appadmin]/appguestPassword specified above is the password of the appguest user and the connected schema is the appadmin schema.
Connected.
SQL> show user
USER is "APPADMIN"
For JDBC proxy connections refer the following metalink notes.
How to use Proxy Users to connect to a Database using Credential Mapping or User Injection. [1529978.1]
How to Ensure USER Session Variable Accurately Reflects "real" User When Using Proxy Authentication with JDBC [431202.1]