anusha chaitanya wrote: I know I can do this with files. But the information is not secure and the file can be deleted at any time. How to do this.
Don't store the password. Instead, store a hash of the password. google "java md5" or "java sha1" for examples on how to do this.
To check the password, you'll need to challenge the user for the password (as previous), but instead of checking the password, you will have to take a hash of the just challenged password, and check if the two hashes match. It is not possible to get the password from the hash, so checking the passwords directly is not possible, but that is what makes it secure.
As for protection against deletion, aren't your program files that can also be deleted too?
Henry