Results 1 to 6 of 6
  1. #1
    Atriamax is offline Member
    Join Date
    Sep 2009
    Posts
    41
    Rep Power
    0

    Default Storing a LOT of strings / data?

    I have been developing a sort of image browsing / managing program, for my some 10,000 photos I've taken over the years (I'm a semi-profressional photographer). Right now it uses folders as categories, I can move images from folder to folder, delete images, upload images in batches to the folders, a simple slide show, and some other simple functions.
    The problem is, many images may fit into more than one category, or I want it to be in a category I don't have, but are too little images to be its own category. So my solution is a tag system, where an image will have several tags and can be searched for, but I don't know how to implement it. Storing several strings for 10,000 photos in a text file seems really inefficient to me; I don't want to have to wait forever for the application to store all the tags in arrays every time I start it up.
    I'm fairly inexperienced with storing data like this, all the external data I've done has been stored in txt files, no more than 100 lines.
    So how should I approach this? Whats the best way of externally storing thousands of strings?
    Thanks.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    Use a database like mySQL.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,447
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by PhHein View Post
    Use a database like mySQL.
    ... or alternatively you could use Derby (a.k.a. JavaDB), it comes bundled with your version 1.6. JDK distribution including all the documentation. You can even store the photo images in the database (as 'blobs').

    kind regards,

    Jos

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Yep. You'll have a photograph table, either with a Blob for the photo or a string referencing the files location on the drive, an id, possibly a description, date taken, that sort of thing.

    You'll have a category table, with id, category name, maybe a description field as well.

    And a photo_category table, with a photo id and a category id. This will map your photo to any number of categories (and vice versa).

  5. #5
    Atriamax is offline Member
    Join Date
    Sep 2009
    Posts
    41
    Rep Power
    0

    Default

    Hmm haven't worked with anything like this before but I'll give it a shot.
    Thanks for the help!

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    At least it's a farily simple database, with only 3 tables.

Similar Threads

  1. Storing data to file :s
    By idi in forum New To Java
    Replies: 3
    Last Post: 02-13-2010, 08:54 PM
  2. Storing data?
    By Syntax in forum New To Java
    Replies: 4
    Last Post: 01-23-2010, 01:17 AM
  3. storing strings into an array
    By anthonym2121 in forum New To Java
    Replies: 2
    Last Post: 04-04-2009, 07:32 AM
  4. Storing data permanently
    By shaungoater in forum New To Java
    Replies: 2
    Last Post: 03-10-2008, 04:18 PM
  5. Storing Data
    By Khorod in forum New To Java
    Replies: 1
    Last Post: 08-03-2007, 05:48 AM

Posting Permissions

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