My problem is that I would like to write all the queries called in my app into a log file. For example: here's a query:
String query = "SELECT * FROM users WHERE name LIKE 'Mike'";
I also have a Connection (DBConnect) object, with which I execute queries like this:
ResultSet myResultSet = DBConnect.getStatement().executeQuery(query);
Since there will be a lot of query call in the app, and more people are developing it, I would like to override the executeQuery method, in a way that before executing the query it would write the given query into a log file. And whenever an executeQuery method is called, it will log the query.
Thanks in advance