The issue is due to the database firewall , for any such connections which are idol for more than 5 mins the firewall disconnects them considering them as stale. Client doesn't aggree on removing the validation, if not 5 mins it can max be 30 mins.
Is there a way through which we can keep database server connection alive by creating a script which interacts with DB. Also for such script do we need to execute from the same port as that of common services as I tried to work on a script at the OS level which establishes a connection with DB but does/doesn't close connection however it didn't work.