I would approach it as follows:
First get the basics of proxy authentication. This article looks promising: https://blogs.oracle.com/olaf/entry/using_oracle_proxy_authenticat
Assuming you have a web application (or something else with one entry point), create a filter that accepts the request, identifies the user, installs the user in the database using proxy authentication, and then redirects the request.
Thus, your application will only see the correct connections with the correct user. Therefore, your Hibernate configuration should not be affected by this.
One warning: you are probably using connection pools. These pools may not pass you the JDBC implementation for Oracle, but a shell through which you need to access specific Oracle functions. Make sure that your application still uses the shell, but the connection pool does not notice any exceptions caused by the connection, thereby not recognizing broken connections and throws them again and again.
source share