The moose likes JDBC and the fly likes Please give me suggestion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Please give me suggestion" Watch "Please give me suggestion" New topic

Please give me suggestion

Deepa Balasubramanayam
Ranch Hand

Joined: Mar 29, 2001
Posts: 39
I am working on a page that does job search.
I have created a textbox and search button. If i type JAVA in the textbox and press search all the jobs available in java is to displayed. The code i used in the resultset is:
ResultSet rs = statement.executeQuery("Select * "+
"From JobTable " + "Where skills like "+ "'%" +variable+"%'");
Variable stores the field that i pass in the textbox.
Now that if i type JAVA,HTML,JAVASCRIPT in the text box. All the jobs available has to be displayed. I wanted to know the code that i can use in my where clause.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Try the StringTokenizer and create multiple like statements separated by "or"

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Raja Shekhar
Ranch Hand

Joined: Apr 02, 2001
Posts: 49
Hi !!
jsut try this...
StringTokenizer stn=new StringTokenizer(textbox,",")
ResultSet rs = statement.executeQuery("Select * "+
"From JobTable " + "Where skills like "+ "'%"

if (rs != null)
while(int i=1;i<=no.of column in the table;i++)
Please let me know the o/p....

Deepa Balasubramanayam
Ranch Hand

Joined: Mar 29, 2001
Posts: 39
Hi Raja Shekhar,
My program is working fine when I used StringTokenizer class.

I agree. Here's the link: http://aspose.com/file-tools
subject: Please give me suggestion
Similar Threads
Need your guidance for building job search page.
Value passed from java to textbox is incomplete
Displaying null using rs.getFloat
to get value from text box using javascript
Display of textbox