• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to store and retrieve data

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on writing a program similiar to an address book. I am still in the design process. I want to have different pages a user can flip through. It will bring up the data for the particular person that page is associated with. I am not sure how to store this data. I could store it in a text file and load it every time but that doesn't seem like the best way. I think using a database may be best but i am not sure how this would all work. how to access it and write and remove from it in my program. Help greatly appreciated.
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could store it in a text file and load it every time but that doesn't seem like the best way

If you're trying to learn to use databases that's fine. However I'm not convinced that reading from a text file and loading the info into memory every time is not the "best way" in this scenario. What problems do you see with that method?
[ August 21, 2004: Message edited by: David Weitzman ]
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Brandon!

If you're curious to learn about accessing a database with a Java program, I'd recommend taking a look at the JDBC assignments of the JavaRanch Cattle Drive. That's how I got started learning it.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seconding David. If you want to learn, fine, but if this is just about writing an application with relatively small data sets then XML serialization seems just the ticket.

- Peter
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic