cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <>
Subject Re: SQLQueryCreator feature add
Date Sat, 04 Dec 1999 07:38:34 GMT
On Thu, 2 Dec 1999, Sidney Chong wrote:

> Hi, I needed to use some session parameters (in addition to request parms)
> in my SQL queries but the stock SQLQueryCreator that came with cocoon-1.5
> can only do request parameters (although the master_default_query_props did
> include session variable delimiters) hence I've decided to build it in
> myself. The code is attached below. It goes into the SQLQueryCreator class
> and replaces the getQuery() mtd.

I checked in patches to CVS that address this and another issue. Lots of
people had said that SQLQueryCreator should be an interface, not a class.
I created a QueryCreator interface (renamed to avoid confusion), created a
DefaultQueryCreator class that does request and session variable
substitution, and removed the SQLQueryCreator class.

Sidney, note that I had to remove the internal StringBuffer from the
substitute method - although your reformulation of the algorithm is likely
more efficient that mine that rewrites strings, your method relies on a
StringBuffer.replace method that doesn't exist in my JDK (I suspect it's a
JDK-1.2 addition). Thanks for the code though. If you have more patches to
submit, please do, but try to check them for JDK-1.1 compatibility first.

- donald

View raw message