Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:35:52+00:00 2026-06-13T05:35:52+00:00

I have an application written in Java where I am accessing data from an

  • 0

I have an application written in Java where I am accessing data from an SQL database. In a few particular scenarios I have the ability to Query the database for information or I could write code in java to obtain the data i need based off of objects that are in scope. My question is this, is it more efficient to use queries when possible or write java code to achieve what is needed. Maybe a specific scenario would help.

I have a scenario where I query the database in order to get a list. After that i write some JAVA code to select only one of those particular objects from the list. In this scenario i used java to establish the object i needed.

An alternative would be to query the database and in my query join two tables together and only return the one object that is needed. In this scenario I would use a Querying language to establish the object i needed.

Any Tips or advice would be appreciated thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:35:53+00:00Added an answer on June 13, 2026 at 5:35 am

    Think this way. SQL queries are much closer to data than java code. Also java needs to load all the data to perform filtering. If you can write efficient SQL, SQL is always better than Java.

    Java filtering is preferable in the scenarios where lot of computation and business logic is involved. I personally prefer writing complex business logic in Java when compared to database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application written mostly in Java. There are a few users
I have a simple web application written in java which has servlets accessing the
I have a few modules of an application that have been written in Java.
I have web application written in java using Eclipse. It has just one servlet
I have this application written in java to calculate pageranks. And the application takes
I have a web-application written in java. I would like to run integration tests
I have an application written in pure/basic Java without GUI. I have three classes
I have a basic web application written in Java, running on a tomcat on
We have a rather large and complex application written in Java which is running
I have my java-written application being killed after some time of work. Java application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.