Hi guys
Just wondering if anyone could point me in the right direction with this.
I have a database connection setup and can get a successful connection.
I have a JTextField called searchField . I would like to be able to search a database and be able to output the results. how would I go about searching the database for what was typed in searchField ?
search button coding
Page 1 of 12 Replies - 266 Views - Last Post: 04 October 2012 - 12:51 PM
Replies To: search button coding
#2
Re: search button coding
Posted 04 October 2012 - 10:27 AM
You would need separate search options. Like if I wanted to search by Author on a library. Or search by first name or last name in a phone book. That way you are searching only specific tables.
For the most basic search function just print out all results that contain whatever is in the text field.
For searching numbers could always convert them to Strings and use the same method.
For the most basic search function just print out all results that contain whatever is in the text field.
For searching numbers could always convert them to Strings and use the same method.
#3
Re: search button coding
Posted 04 October 2012 - 12:51 PM
Use the getText() method on the JTextField and bind the String to a PreparedStatement.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|