You can use a text file for this but it is difficult. You cannot just insert into the middle of a file, nor can you just delete. You will end up rewriting the entire file out again.
You may find it easier to use a 100% Java DB embedded into your application like
HSQLDB I've used it before and it is very easy.
Good luck.