db connection and content extract