db connection and subscribe script