Results 1 to 8 of 8

Thread: Image Handling

  1. #1
    yaigesh is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Question Image Handling

    Hi All

    I am developing a small application in which I want to upload images first with small description and name. Later I want to put the name of the fie to retrieve it.

    I want to know is it good to just store the address of the image in the database instead to storing the entire image?

    Like, If I copy the image from one location and put it in a protected folder and in the database, just store the address of the image. Later, when I want to retrieve it, it can again use the address/path (stored in the database) of the image. It will save lot of space on database.

    Is it a good approach? What can be pitfalls?

    Also,I am trying Netbeans 7 for this... any suggestions???? Shall I continue using Netbeans (as I am not getting enough tutorial on this) or is there any better option like swings or Servlets or anythign else?

    Regards

    Yaigesh Mehra

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: Image Handling

    Since the database uses the file system to store its data (especially LOBs) you're not really saving anything much holding it on the file system.
    One pitfall is the image is no longer tied to the entry in the database.
    Move the image, change the directory name, whatever, and that entry is now no longer valid.

    Netbeans is an IDE, so not sure what you think you;re asking with the last part.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    Feb 2012
    Location
    Queensland, Australia
    Posts
    12
    Rep Power
    0

    Default Re: Image Handling

    Storing the image in the filesystem may mean that it would be faster loading the image onto a form or processing it. But you have the issues that Tolls described which can potentially occur.

    Their will always be some overhead in retrieving the image from a database in terms of speed, but the advantage is that you have both your data and images in a centralized repository.

    In the end it is a trade-off.

    Regards

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,415
    Rep Power
    20

    Default Re: Image Handling

    Quote Originally Posted by Glorfindel Arnatuile View Post
    Storing the image in the filesystem may mean that it would be faster loading the image onto a form or processing it.
    Really?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    Join Date
    Feb 2012
    Location
    Queensland, Australia
    Posts
    12
    Rep Power
    0

    Default Re: Image Handling

    What strategy you use depends on your situation and your requirements.

    I am new to java but have had an asp.net background.

    This article sums up my opinion.

    To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem - Microsoft Research

    Regards

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: Image Handling

    Quote Originally Posted by DarrylBurke View Post
    Really?

    db
    This did used to be the case, but I'm not sure it still applies.
    It could be quite marked, if I remember the metrics from several years ago.
    However things have changed, driven simply by more people wanting to keep their data in synch.
    I know Oracles LOB reading performance is more than sufficient, and has been for a while now.

    Filesystem storage also has another problem, depending on the FS you might encounter a restriction on the number of images a folder can contain, so you need a mechanism for monitoring that.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    yaigesh is offline Member
    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    Default Re: Image Handling

    Quote Originally Posted by Tolls View Post
    Since the database uses the file system to store its data (especially LOBs) you're not really saving anything much holding it on the file system.
    One pitfall is the image is no longer tied to the entry in the database.
    Move the image, change the directory name, whatever, and that entry is now no longer valid.

    Netbeans is an IDE, so not sure what you think you;re asking with the last part.
    I meant that can I use multiple selection of images and uploading of the same in the database? Or I shall use some other tool instead of Netbeans? like Servlets?

    regards
    Yaigesh

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: Image Handling

    Netbeans is not your app.
    You write your app in Netbeans in the same way you write your DOC in Word.
    So asking whether it should be in Netbeans or Servlets is meaningless.

    So. What are you attempting to do?
    Where are these images?
    Is this going to be a webapp or desktop app, or simply a command line tool?
    Only you can answer these questions since it's your requirements.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 07-28-2011, 08:48 AM
  2. Replies: 12
    Last Post: 04-14-2011, 01:58 PM
  3. Replies: 14
    Last Post: 04-10-2009, 08:46 AM
  4. CropperImage-Image Handling
    By Alex_K in forum Advanced Java
    Replies: 0
    Last Post: 02-26-2009, 01:15 PM
  5. Replies: 0
    Last Post: 01-08-2008, 05:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •