Making db connection