Prepare to connect to database