aspose file tools*
The moose likes JDBC 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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Select Where Clause in servlet" Watch "Select Where Clause in servlet" New topic
Author

Select Where Clause in servlet

Jack Adams
Greenhorn

Joined: Jun 08, 2004
Posts: 24
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.

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

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

Joined: May 26, 2003
Posts: 29287
    
140

Jack,
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?


[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: http://aspose.com/file-tools
 
subject: Select Where Clause in servlet
 
Similar Threads
Table Relationship
scope of alias in subquery
Reg:File Size
how do I code a like clause with Hibernate?
how to write sql query