M
Muggle
Hello everyone,
I have a situation and need some help.
Our application is providing a web-service like service to a
presentation layer application. The presentation layer application
gathers the user inputs and send an XML request. Our application looks
up in the database, generates a response XML, and sends back.
The user can enter any combination of inputs(one or more), and there
are 15 of them. My task is to generate the query(the 'where' clause)
and pass it to a Weblogic database control. What I currently do is, I
put the incoming parameters in a HashMap with the corresponding column
names in the table as keys. Then I pass the Map to a helper method
which iterates through the map and generates the 'where' clause.
I think this approach is ugly because some of the paramters are muti-
valued, some are date-ranges and some include wild cards and therefore
require a lot of tinkering. Besides it is almost impossible to
accomodate any change in the business logic.
I apologise if the picture I present here is not clear. I would
greatly appreciate if anyone can shed some light or point to somewhere
I can look for samples.
(Please take into account the facts that this is JDK 1.4 and I have
absolutely zero control over the overall design)
Thanks in advance
Muggle
I have a situation and need some help.
Our application is providing a web-service like service to a
presentation layer application. The presentation layer application
gathers the user inputs and send an XML request. Our application looks
up in the database, generates a response XML, and sends back.
The user can enter any combination of inputs(one or more), and there
are 15 of them. My task is to generate the query(the 'where' clause)
and pass it to a Weblogic database control. What I currently do is, I
put the incoming parameters in a HashMap with the corresponding column
names in the table as keys. Then I pass the Map to a helper method
which iterates through the map and generates the 'where' clause.
I think this approach is ugly because some of the paramters are muti-
valued, some are date-ranges and some include wild cards and therefore
require a lot of tinkering. Besides it is almost impossible to
accomodate any change in the business logic.
I apologise if the picture I present here is not clear. I would
greatly appreciate if anyone can shed some light or point to somewhere
I can look for samples.
(Please take into account the facts that this is JDK 1.4 and I have
absolutely zero control over the overall design)
Thanks in advance
Muggle