Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help with this problem

 
Nasim Jones
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you can use RandomAccessFile to build the low-level access to file storage. Maybe this article can help:


http://www.javaworld.com/javaworld/jw-01-1999/jw-01-step_p.html
 
Stephen Foy
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ]
 
Nasim Jones
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
etc...
Hope that helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic