It's not a secret anymore!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
 
subject: getting data from the database with the non mandatory fields
 
Similar Threads
fields should be mandatory depending on drop down select
DynaValidatorForm not allowing insert.
AST6: Mapping EJB / RDB With Views in Oracle9
intermediate submit and validation of a form
Program action of a page dynamically depending on the link from where it is called