added DB access

works locally, hope it works on AppHarbor.  :)