in reply to easier to get data from a database

That's a neat shortcut.

The downside is that it's horribly inefficient. You're slurping in the whole table every time, rather than just what you need, and doing an extra query to get the contents of the table. Don't get too reliant on this shortcut, because it will not be acceptable in applications that have performance demands.

But for code where performance doesn't matter much, and you always read in the entire contents of a table (preferably only once!) it's a good trick.

-- Kirby, WhitePages.com