Setting up db connection for messages