utility for connecting to the database