Hi,
I have to use a default Role so that after the datasource has been defined and connected that role will allow me to use select statements. I know its little weird but I have to do it due to security concerns. So here is the code in my Spring's applicationContext.xml:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
<property name="url"
value="jdbc:db2://host_name:Port/DB_NAME:INFORMIXSERVER=SERVER_NAME;DELIMIDENT=y;" />
<property name="username" value="user" />
<property name="password" value="password" />
<property name="minIdle" value="2" />
</bean>
Everything is fine I am able to connect to the datasource but I also need to tell the database that all the queries will be through this ROLE so that I do have select rights and stuff: For command prompt I am doing like this:
set role ROLE_ACCESS_SELECT;
before executing sql commands but don't know how to set it up here.
Please advice.