Establish database connection