prepare database connection