aspose file tools
The moose likes Java in General and the fly likes Store Data WITHOUT arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Store Data WITHOUT arrays" Watch "Store Data WITHOUT arrays" New topic
Author

Store Data WITHOUT arrays

Tony Cossie
Greenhorn

Joined: Mar 11, 2001
Posts: 13
Hi,
I am writing a program for a warehouse stock inventory. One of the requirements is to have a program that updates the stock levels (sold/bought). I'm using using binary files for this. Is there anyway apart from using arrays to update the stock? (i was wondering if there was anything more memory efficient?)
Thanks,
T.C
[This message has been edited by Tony Cossie (edited April 12, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
That is what databases were made for. Surely you have an Access or Oracle database around somewhere? If not you should seriously think about getting one, it will make you life much easier and more efficient.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Tony Cossie
Greenhorn

Joined: Mar 11, 2001
Posts: 13
Oh i know about databases. but this is a programming assignment i have to do. I think i have it figured out now though. I cannot use Access, Oracle or SQL or anything of that ilk
Paul Ralph
Ranch Hand

Joined: Aug 10, 2000
Posts: 312
Umm...just wondering why you couldn't use a database. Not enough space?
Paul R
Travis Gibson
Ranch Hand

Joined: Oct 17, 2000
Posts: 100
Tony,
It sounds to me like what you need to use is a Collection.
Go to the following link: http://java.sun.com/docs/books/tutorial/collections/intro/index.html
The Hashtable is one of my favorites. Think of it as a keyed data file.

------------------
Regards,
Travis M. Gibson, SCJP
Java Developer
www.travismgibson.com
travis@travismgibson.com


Regards,<BR>Travis M. Gibson, SCJP<BR>Java Developer<BR>www.travismgibson.com<BR>travis@travismgibson.com
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
Arrays or in-memory objects are probably not the best choice if the data needs to be persistent. For simple applications, java.io.RandomAccessFile works fine.
------------------
Phil Hanna
Author of :
JSP: The Complete Reference
Instant Java Servlets


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Store Data WITHOUT arrays
 
Similar Threads
�Understanding this program?
stock control
Files vs Arrays?
Creating random Unique values
help needed immediately