This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes how to search values in database 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 "how to search values in database" Watch "how to search values in database" New topic
Author

how to search values in database

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Hi,

I want to search values saved in database, I do not think it is good to retrieve all values from the database then search it.

May I know what is the best way to solve this problem.



Subhani Sk
Greenhorn

Joined: Oct 04, 2003
Posts: 5
What do you mean by search in database?

You can use WHERE Clause in SQL to search.
Avyaya Avi
Greenhorn

Joined: Feb 04, 2009
Posts: 11
Get the values in a particular row using the SELECT query.

Check for the value in your code with the values retrieved from DB using the while loop.Simple.

If you are aware of the column name which hosts the value of yours, then retrieve only the values stored in that column rather than entire data in the table to reduce the overhead.
 
Don't get me started about those stupid light bulbs.
 
subject: how to search values in database
 
Similar Threads
frequently changing init parameters
How to give search query if we select one than one value from combo box
Event Handling
jsf page refresh
Search from a JSP page