Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2100

Re: Database implementation of java.util.prefs.Preferences?

From Daniel Pitts <newsgroup.nospam@virtualinfinity.net>
Newsgroups comp.lang.java.help
Subject Re: Database implementation of java.util.prefs.Preferences?
References <505a3037$0$1299$65785112@news.neostrada.pl>
Message-ID <qk17s.2$D77.0@newsfe15.iad> (permalink)
Date 2012-09-21 10:19 -0700

Show all headers | View raw


On 9/19/12 1:51 PM, Marcin wrote:
> Hello
>
> I have a Java program that uses java.util.prefs.Preferences to store
> configuration data. Everything is OK if one user works on one computer
> but if one user can use many computers the data is not shared between
> workstations and "environment" is different dependent on which computer
> user is logged in. I think I can store the same data in database because
> application uses connection to database for other purposes. Do you know
> any implementation of abstract class java.util.prefs.Preferences  that
> uses SQL to store the configuration data? I cannot google anything
> interesting...
>
> Regards,
> Mar

If you need to store preferences across computers, 
java.util.prefs.Preferences is not the class to do it with. 
java.util.prefs.Preferences was basically meant to be a Java interface 
into the Windows Registry (with a more system-independent back-end). 
You will want to create your own way of persisting user preferences 
which involves storing them on some server somewhere.  You could put it 
into the same database as your application's domain database, though it 
isn't a good excuse that "I'm already connecting to it."

It may be a better implementation to have a separate Preferences 
database, or web-service, or whatever makes sense in your 
environment(s).  Personally, I like the "web-service" approach, but that 
is 80% of what I do on a daily basis, so my preference (no pun intended) 
is biased.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Database implementation of java.util.prefs.Preferences? Marcin <nomail@nospam.com> - 2012-09-19 22:51 +0200
  Re: Database implementation of java.util.prefs.Preferences? markspace <-@.> - 2012-09-19 15:28 -0700
    Re: Database implementation of java.util.prefs.Preferences? "John B. Matthews" <nospam@nospam.invalid> - 2012-09-19 20:59 -0400
      Re: Database implementation of java.util.prefs.Preferences? markspace <-@.> - 2012-09-19 19:07 -0700
        Re: Database implementation of java.util.prefs.Preferences? "John B. Matthews" <nospam@nospam.invalid> - 2012-09-20 12:20 -0400
  Re: Database implementation of java.util.prefs.Preferences? Roedy Green <see_website@mindprod.com.invalid> - 2012-09-21 07:12 -0700
    Re: Database implementation of java.util.prefs.Preferences? "John B. Matthews" <nospam@nospam.invalid> - 2012-09-21 21:10 -0400
  Re: Database implementation of java.util.prefs.Preferences? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-09-21 10:19 -0700

csiph-web