• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help in searching

 
jyotsana dang
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi.. i have made an intranet website in jsp where a user an search in for another user's records based on his firstname, lastname or year.Any or all of these keywords will be used as the search criteria. Year is from 2003 to 1998.
Iam using sql as the database..and have a main table where the firstname, lastname, login_name and password of the users. And there are 10 different tables where each users records are stored.
Can anyone tell me a bit as to what will be the best in searching the records. I tried joining the tables and displaying the output. But it is not working properly.

Will views be a better way to do the same.
 
Owee Nicolas
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jyotsana,
You could try manipulating the String of your SQLStatement before running the SQLStatement. Since you mentioned that the criteria can either be firstname, lastname or year, you could check on your JSP code what parameters are used for the query (firstname, lastname or year). Then concatenate only the parameters that will be used on the String of your SQLStatement. The joining of the tables will only be used for displaying the user records.
Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic