Connect to Database Activity from UiPath.Database.Activities helps establishing the connection to the database and return the Database Connection object as output.
Use If activity with the output variable from the above activity to check
If (DBConnection is Nothing)
If true, Establish the new connection
Else, The Connection exist.