File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Select Where Clause in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Select Where Clause in servlet" Watch "Select Where Clause in servlet" New topic

Select Where Clause in servlet

Jack Adams

Joined: Jun 08, 2004
Posts: 25
I have code that contains select stmts. The select stmts' where clauses are appended with DOZENS (HUNDREDS) of conditions. A select stmt can run fine for weeks and then break when a specific condition is choosen from web page.

select, e.employeeid, e.birthdate,
from employee , company
if (filter on name)
name = thename
-error name not qualified
s/b = thename

How should this be handled/designed future/present?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32077

How are you testing your code before you release it? You need to make sure all the conditions are tested. Can you do a "sanity check" query by testing all the conditions at once?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Select Where Clause in servlet