copied DbFactory methods to Database

marked DbFactory as obsolete