I’m developing a Java application that connects to an Oracle database using JDBC. In this application, I need to track the user who interacts with database objects from the UI for the current session. To achieve this, I’m attempting to set client information properties such as the client username (ClientUser) using the setClientInfo method in JDBC, like so:
conn.setClientInfo("ClientUser", "some.username");
However, when executing this code, I’m encountering the following error:
Java.sql.SQLClientInfoException: Invalid or unsupported name for clientInfo.
In addition to resolving the JDBC error, I’m also interested in learning how to retrieve the client user information (ClientUser) directly from the Oracle database.