*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help with this problem" Watch "need help with this problem" New topic
Author

need help with this problem

Nasim Jones
Greenhorn

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:


http://www.javaworld.com/javaworld/jw-01-1999/jw-01-step_p.html


<a href="http://www.newinstance.net" target="_blank" rel="nofollow">http://www.newinstance.net</a>
Stephen Foy
Ranch Hand

Joined: Oct 17, 2005
Posts: 143
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 ]

Stephen Foy - Microsoft Application Development Consultant
Nasim Jones
Greenhorn

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
etc...
Hope that helps


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: need help with this problem
 
Similar Threads
in dropdown problem
read the XML file
xml JAVA
sending/retrieving data via SQL statements...
sign up and sign in application using struts