If all my Spring JDBCTemplate queries have to go through an Oracle VPD (Virtual Private Database) Connection how would I set up my datasource in the Application Context file?
1 Answer
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@xxx.xxx.com" />
<property name="username" value="user***" />
<property name="password" value="pass***" />
<property name="connectionInitSqls">
<util:list>
<value>call PKG_RLS.SET_CONTEXT ('admin', '0', 'SET_VALUE')</value>
</util:list>
</property>
</bean>
-
Doesn't this mean that every time you make a connection you have admin visibility? What about when you want to make a connection as a regular user? There should be a way to dynamically set the parameters. Oct 29, 2018 at 17:06