GeeCON Prague 2014*
The moose likes JSP and the fly likes getting data from the database with the non mandatory fields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "getting data from the database with the non mandatory fields" Watch "getting data from the database with the non mandatory fields" New topic
Author

getting data from the database with the non mandatory fields

pasham sukumar
Greenhorn

Joined: Jan 23, 2012
Posts: 2
i want to get the data into the jsp by using jsp,servlet and oracle
I have a form in jsp in that 6 fields are there in that only one field is mandatory and
rest of five fields are not mandatory for this how to write the code for generating the report after submit button
how can i write the conditions for the non mandatory fields. Can you suggest me for this.
Pongsakorn Semsuwan
Ranch Hand

Joined: May 15, 2011
Posts: 34

In Servlet, get all the input parameters from your form and check if user put something in those optional fields or not.

If user does, you add an additional condition to your query. If not, go with you simplest mandatory query.


A web application developer wannabe from Thailand
My StartUp : http://www.dreamlog.co
Blog : http://pongsakornsemsuwan.wordpress.com
 
GeeCON Prague 2014
 
subject: getting data from the database with the non mandatory fields