Monday, January 12, 2004

Squiggle SQL Builder

Table people = new Table("people");

SelectQuery select = new SelectQuery(people);

select.addColumn(people, "firstname");
select.addColumn(people, "lastname");

select.addOrder(people, "age", Order.DESCENDING);

I've seen (and also written (in proprietary code I can't show you)) this kind of thing before. It makes me wonder why the hell wasn't something like this included as a basic part of JDBC, since it makes SQL so much more usable.