We are using spring data combined with JNDI lookup to get hold of datasource and establish a connection.
<bean id="testDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/testDs"/>
</bean>
I am looking for a solution to write wrapper before getting DB connection, so that I can log time either in logs or inserting a new record, block few transactions to few tables based on insert/delete/update statements.
Currently, we are not thinking of using database triggers. Any help/advice/example would be greatly appreciated.