ODBC Adapter-lost connection-JDEDwards XPIe

Hi,
We are using Jdedwards XPIE(webmethod 4.5) and our previous developers wrote integration components in ODBC intelligent adpater.Our database is Oracle.
We need to know when ODBC connection is lost for out audit records.
Can somebody give sample code to know lost ODBC connection