added before & after connect callbacks for db widget, ref #98