• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Where to store application settings ?

 
Ranch Hand
Posts: 67
PHP Debian Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
PHP Debian Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
PHP Debian Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
PHP Debian Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic