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

  • SEARCH
  • Home
  • 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 7178733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:58:46+00:00 2026-05-28T16:58:46+00:00

As i am developing the web application in J2EE, i have to be very

  • 0

As i am developing the web application in J2EE, i have to be very careful about the database calls.

I am storing the images in database(BLOB).

For accessing those images, i created a servlet file.

I am passing id to that file as GET method.

For showing the image, i needs to call that servlet file.

But as that servlet file making another database call, which i am most concern.

For example:

If in that particular jsp file, i wants to show 3 rows, i will make 1 call to show those rows AND another 3 calls for showing those images.

I have 2 options

  1. Create a global variable and access that variable in jsp as well as in servlet.
  2. Instead of creating the global variable, pass the database object to session variable.

But for me both are not good.
Please suggest somethings.

  • 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-05-28T16:58:47+00:00Added an answer on May 28, 2026 at 4:58 pm

    If you’re concerned about the load imposed to your database, you should probably avoid storing images in it. Instead, store the images on the disk, and store their path in the database.

    This way, when you need to display three images in a single page, you execute a single query to get the paths of the three images, and you generate an HTML page containing the 3 paths.

    If you have no other choice than storing the images as blobs in the database, and if you have load-tested your application, and showed that getting them from the database caused a significant performance problem, then consider using some application cache (like EHCache), to remove load from the database. You could also get the three images at once from the database and store them in the session, but you would have to find a way to cleanup the session, else the memory of your app would climb very fast.

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

Sidebar

Related Questions

I am developing a dynamic web project j2ee web application using eclipse. I have
I'm developing a J2EE 6 Web Application, using a MySql 5.02 DataBase. I'm trying
I'm developing a J2EE-based web application on a SAP Netweaver Application Server. I have
When developing a web application using ASP.NET, do you have any hints about how
I am developing a web application which has Chart Controls. I have developed a
I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have
I am developing web application where users have collection of tags. I need to
I'm developing web-application (and also native iOS app) that uses images from different websites.
Im developing a web application(J2EE,Struts2,JSP,Tomcat) I want to hide the .jsp extension from webpages.
We're developing a web application which uses EJB to connect to a database. In

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.