Doubt on a logic to store constant in file.
Hi,
In my project I need to store 5 rows of values as follows but not in DB and should be editable when needed.
| Id |
Code |
Type |
Place |
| 1 |
code_1 |
type_1 |
Canada |
| 2 |
code_2 |
type_2 |
India |
| ... |
... |
... |
... |
How this can be done in a better way ?
Condition : The file I am going to store this should not be a class file.
It can be comma (or any special character) separated. No issues in how it is stored in.
I know that it can be stored in a text file and can fetch when needed. But I need a simplest and a good way to achieve this.
Re: Doubt on a logic to store constant in file.
Look at the FileWriter or PrintWriter classes.
Re: Doubt on a logic to store constant in file.
Thank you Norm for your quick reply.
I forget to mention that it is a web based project. Will it be good / make any problem if I am using fileWriter/PrintWriter ?
And I was expecting something different as I told in the last line of my first comment.
Re: Doubt on a logic to store constant in file.
Please explain what you mean by "web based". Do you mean an applet or a server?