guys, i have a project that have to implement a reservation system by using java. Is it database the only way to store the data? Is there other method beside by using database? If database is the only way to do that, can anyone tell me how to do so in the code? i have seen so many thread inside here..but thre are a lot of them and each of them are different...im confusing which one is the correct one..Please give me your opinion thanks..

no idea how to start...perharps..can i do it in other way beside database?

can i do it in other way beside database?

Yes but.
As an alternative you could design a way to use files and folders to store your data.
The keyword here is design.
Some day though you will have to learn databases.

Yea...my lecturer did mention that i could use a file to store the data. But i was just try if i could do it in database...But now i realise that its too complicated for me. I just start learning java for less than 2 month. Anyway , thanks for your help !

OK. Here's the quickest way to do it. First, make sure that the data you need to save is held as instance variables in one or more objects in your program. Then do this: (words in italics are things you can look up in the Java API documentation)
create a File object to hold your data. create an ObjectOutputStream using that file. Use the writeObject method to write your program's objects to the file. To get it back, use an ObjectInputStream and its readObject method to get your objects back

I think the OP should design how and what data needs to be read/written/updated before deciding on what technique to use to hold the data on disk.

This article has been dead for over six months. Start a new discussion instead.