We are working in .NET4.5 against Oracle 12.1 and would like to utilize Oracle virtual private database to control data access. We are having difficulty finding the proper way to pass the User ID to Oracle in order to set OS_USER using the dotConnect driver.
We have a working example to set the OS_USER of an Oracle v$session using Java as seen below:
Properties props = new Properties();
props.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER, “user1”);
OracleConnection oConn = (OracleConnection) DriverManager.getConnection(sharedUrl, props);
Reference: http://docs.oracle.com/cd/E18283_01/app ... ION_OSUSER
We were not able to determine if it is possible or how to implement it from the dotConnect documentation. Do you have any sample code using VPD or can you provide any insight on how to set the OS_USER parameter during connection?
How to set OS_USER for in order to use VPD
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: How to set OS_USER for in order to use VPD
Unfortunately, dotConnect for Oracle does not offer such features as Java driver.jcarter wrote:We have a working example to set the OS_USER of an Oracle v$session using Java as seen below:
dotConnect for Oracle can work in two modes:
1. OCI connection mode. In this mode the data are passed to Oracle Client, and it performs all the actions on recognizing and connecting OS_USER. dotConnect for Oracle does not affect this process. Please ask Oracle support if it is possible to change OS_USER in Oracle Client settings.
2. Direct mode. This mode allows you to connect without Oracle Client. Currently, OS authentication is not supported in the Direct connection mode. We are investigating the possibility to set OS authentication in the Direct connection mode, but we can't tell any timeframe at the moment.
dotConnect for Oracle has the ClientId property, which allows sending client identifier. You can use it to configure Virtual Private Database.jcarter wrote:We are working in .NET4.5 against Oracle 12.1 and would like to utilize Oracle virtual private database to control data access.