This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes need help with this problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help with this problem" Watch "need help with this problem" New topic

need help with this problem

Nasim Jones

Joined: Apr 03, 2006
Posts: 2
i've just started learning java and mi tutor has given me this assignment, can someone please help please!!!

Transaction Processing

Using Java create classes of a system that must support the following transactioons;

> add a student specifying all the required details
> delete an existing student
> Correct the student details
> Print selected or all information about the Student to the report log

The details must be stored in a Text file (Flat database)

Even the logic without the coding will be appreciated.
Manuel Palacio
Ranch Hand

Joined: Oct 16, 2000
Posts: 45
I guess you can use RandomAccessFile to build the low-level access to file storage. Maybe this article can help:

<a href="" target="_blank" rel="nofollow"></a>
Stephen Foy
Ranch Hand

Joined: Oct 17, 2005
Posts: 143

It would help us if you told us what exactly is bothering you with thtis assignment?

Are you comfortable working with multiple classes?
Can you create constructors?
Can you write/read from files?
[ April 03, 2006: Message edited by: Stephen Foy ]

Stephen Foy - Microsoft Application Development Consultant
Nasim Jones

Joined: Apr 03, 2006
Posts: 2
I know how to read/write from files, but the problem is that I dont know how to use a txt file as a database. I heard someone saying I should use pad utility but I dont know how to implement it.
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
To use a flat file all you have to do is first create a Table structure that you will use to store the details e.g. For student details you will have say Student number, first name, last name, class etc.
Now in one record all these fields you can save as a comma separated line of the text file.
Then you will have to write methods
1. to read a record
2. to delete a record
3. Update a record
Hope that helps

-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
I agree. Here's the link:
subject: need help with this problem
jQuery in Action, 3rd edition