db-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <mccallis...@forthillcompany.com>
Subject Re: [sql] move from commons sandbox to db or db-commons?
Date Sat, 20 Dec 2003 15:17:44 GMT
On Dec 20, 2003, at 1:49 AM, Henri Yandell wrote:

> I think DbUtils in Jakarta Commons might have something along those 
> lines.
> The bits I was interested in were a lot more basic when I started it, 
> but
> others have taken it in more interesting directions since.

Unfortunately, it doesn't. It has support for the 
usually-better-practice of externalizing your queries, but it doesn't 
have anything for dynamic construction of queries a la:

QueryBuilder q = QueryBuilder.select().where("a.name like 
{name}").leftOuterJoin("a", "b", "a.id = b.aid").all();
String sql = q.getQueryString();
// select * from a left outer join b on a.id = b.aid where a.name like ?

Or the real case of having a delegating builder to build the query 
based on various properties, or a switch, or even a classic chain of 

It is the type of thing I have seen at least a dozen schemes for doing, 
and have done a couple times myself -- a candidate for a common 
library, in other words =)


View raw message