OMG, are you really keeping your own database up to date? I'm so sorry about you...
First tip: If you only need a very simple and minimal solution to detect brand and model, go with WURFL if you want it for free or DeviceAtlas if you can afford it. The second one probably works better (just my personal opinion).
Also, take a look at this comparision DeviceAtlas vs WURFL (dead link).
Second tip: As a general rule, it is a good idea to stay tuned with the W3C standards. In that sense, the DDR Simple API (Device Description Repository Simple API) is the way to go. It describes an abstract API to access Device Description Repositories (DDRs).
You can find an open-source reference implementation of that API in Java as part of MyMobileWeb project (dead link). It allows you to access WURFL, DeviceAtlas (not 100% sure), W3C DDR Core Vocabulary (and maybe UAProf). This way you can access device properties with a unified API, that is also offered as a REST service (see DDR REST service documentation).
You can download the latest 1.2 version. I know they are working in a new version that could probably be released by october and a Rails implementation.
What that means, in practice, is that you can develop your application using WURFL and later switch to another repository, keeping your code ideally untouched. It is harder to install and use for the first time, but if you are building a big enterprise system, you'll save a lot of time in the future.
I have to say I've previously worked on that project, I think it's worth a look in any case, despite W3C standards are usually hard to read. Maybe there are other alternative implementacions of the DDR Simple API out there.