Check if the connection is closed before closing in transact and result set
Fix: No trailing slash after the database name