This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to store application settings ?

 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i got some app and i would like to store user's chosen settings, which option would be best? I got only idea to store data in sqlite or use some ini file. Put ini file would be too easy open and see sensitive data like passwords even if i encrypt them.
 
Bill Cruise
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Java Preferences API. You're right about passwords though, those should be stored separately in a database or an encrypted file.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A database is a good choice because it is meant to store organizational information. You would still want to encrypt the passwords of course. I don't think a database is any more secure than a file for passwords though. Anyone with access could still view the encrypted password. Which SHOULD be secure either way because it is encrypted.
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for replies and i dont know now which to choose DB sqlite or that Pref API, if the Pref API is faster then I pick that.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this is a desktop app I'd go with the Prefs API. There's no need to start messing with a database just for storing application preferences.
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeha i thought same, so i am going to use Pref API
//Edit
Can't find file where it stores data?
[ July 14, 2008: Message edited by: mandlar suurla ]
 
mandlar suurla
Ranch Hand
Posts: 67
Debian Linux PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont want to make new topic so i use my old one. So i tried to make use of my own configure class but that wasn't good idea. I am going to use pref API, but there is one little problem, as you insert or get the data you need to provide default data, but when i am using same fields in my app many times and in some other classes its like over typing same thing.

So my idea is to use "" empty string for default. If anyone got any good solution, then please help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic