File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to search values in database

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by search in database?

You can use WHERE Clause in SQL to search.
 
Avyaya Avi
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic