One way to do that is to create DB2 connectors that wraps all connections.
For example, a JDBC connector, that captures the statement, and then send it to DB2. You will need to receive all possible parameters, and send that to DB2. In the other way, you need to get all from the IBM driver and send back to the user.
A similar thing for ODBC and other connectors.
Finally, for command line, you can create something similar to rlwrap, where you can capture the query and send it to db2clp.
However, this solution is local for each connection, then, you need a method centralize all statements.