• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to give search query if we select one than one value from combo box

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In search....

i have one field like type: with type1,type2,type3 as options in combo box
i have selected 2 values type1,type2....then how to query the database to get result based on type1,type2 values..
[ July 10, 2008: Message edited by: Kittu ]
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kittu welcome to Javaranch,
Firstly your name does not follow the Javaranch Naming Policy please change ithere

then tell exactly what are you trying to do,what are you searching, I think you want to query a database using the user input, if yes then what is the problem.
[ July 10, 2008: Message edited by: Amit Ghorpade ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"krishnaveni_sv", please check your private messages for an important administrative matter. Again.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, there is no such things as a "combo box" in HTML. Please read this for more information.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By combo box, you mean <select> box?



Statement can be replaced by PreparedStatement, but not sure.

Hope this helps.
[ July 10, 2008: Message edited by: arunkumar subramanian ]
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arunkumar, please note your code is not safe for SQL injections. In particular the input String "'); DELETE FROM Users; SELECT * FROM widgets WHERE ID IN ('1" might cause you some problems (or variations on it)
[ July 10, 2008: Message edited by: Scott Selikoff ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic