How to export test run results per test case to database

I trying to dynamically export test case results to database.
1. Is this something that could be achieved by TearDownifPass,TeardownifError,TeardownifFail
2. If so how can i achieve this ?