How to set OS_USER for in order to use VPD

How to set OS_USER for in order to use VPD

Postby jcarter » Tue 28 Apr 2015 12:58

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/appdev.112/e13995/oracle/jdbc/OracleConnection.html#CONNECTION_PROPERTY_THIN_VSESSION_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?
jcarter
 
Posts: 3
Joined: Thu 26 Mar 2015 15:26

Re: How to set OS_USER for in order to use VPD

Postby Pinturiccio » Wed 29 Apr 2015 14:06

jcarter wrote:We have a working example to set the OS_USER of an Oracle v$session using Java as seen below:

Unfortunately, dotConnect for Oracle does not offer such features as Java driver.
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.

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.

dotConnect for Oracle has the ClientId property, which allows sending client identifier. You can use it to configure Virtual Private Database.
Pinturiccio
Devart Team
 
Posts: 1982
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle