I’m trying to find a specific record. So what’s better to do? Use a mysql statement to find the record or grab the whole table, put in a arraylist and iterate through it until I find what I want?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is always better to offload database work to database.
Some of the advantages I see are:
You will get only the data you want, which improves performance, result will be faster (Most of database servers comes with optimization to improve query execution paths).
Save the space. You don’t need to keep unwanted data in runtime memory