Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Store objects using the Preferences API

Store objects using the Preferences API The Preferences API -- a lightweight, cross-platform persistence API introduced in JDK 1.4 -- is designed to store small amounts of data (string, simple byte arrays, and so on.) and was not intended to be an in

Tutorial Details:

The Preferences API is designed to store strings, numbers, booleans, simple byte arrays, and the like. In this article, we will show you how to store objects using the Preferences API and provide a working library that takes care of the details for you. This is useful if your data is easily expressed as simple objects, rather than as separate values like strings and numbers.

We\'ll begin with a brief discussion about the API, including some simple examples of its use, then go into the details of how objects are stored using the API and lay out the code that takes care of this for us. We also demonstrate some examples of the API in action.

Why design the Preferences API?
It would be surprising if the Preferences API was created mainly to allow Java programs to access the Microsoft Windows registry. Why do I mention this? The design of the API is similar to that of the Windows registry; most of the statements in the first three paragraphs of this article apply equally well to the registry.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Store objects using the Preferences API

View Tutorial:
Store objects using the Preferences API

Related Tutorials:

A portable hill of beans
A portable hill of beans
 
Reloading Applets
Reloading Applets
 
Use JNDI to share objects between different virtual machines - JavaWorld July 1999
Use JNDI to share objects between different virtual machines - JavaWorld July 1999
 
Deliver cellular messages with SMS - JavaWorld March 2001
Deliver cellular messages with SMS - JavaWorld March 2001
 
Manage distributed sessions - JavaWorld April 2001
Manage distributed sessions - JavaWorld April 2001
 
Personalize your Website with skins - JavaWorld June 2001
Personalize your Website with skins - JavaWorld June 2001
 
Sir, what is your preference?
Sir, what is your preference?
 
Write once, persist anywhere
Write once, persist anywhere
 
J2EE or J2SE? JNDI works with both
J2EE or J2SE? JNDI works with both
 
A recipe for cookie management
A recipe for cookie management
 
Good introduction to JDO
Good introduction to JDO
 
Comparison between the two major JDO architectures
Comparison between the two major JDO architectures
 
The first taste of Liberty
The first taste of Liberty
 
High-availability mobile applications
High-availability mobile applications
 
Introducing the Portlet Specification, Part 1
Introducing the Get your feet wet with the specification's underlying terms and concepts
 
Very interesting
Very interesting
 
OpenSign
OpenSign OpenSign is a java applet for signing text in a webbrowser using a PKCS-12 key-files or keys located in MS Crypto API CSP's in a Win32 environment. The applet is based on code kindly provided by IT-Practice and everyone is encouraged to subm
 
OIL (Objects in a Line)
OIL (Objects in a Lile) provides a queue API and its implementation which is required by many server applications which stores client requests permanently in order. OIL provides: Queue which provides sequential access. Index which provides random acce
 
Using Lucene With OJB
Brian McCallister looks at the Lucene search engine and shows us how to index and retrieve objects from a sample Student application.
 
What is Persistence Framework?
What is Persistence Framework? What is Persistence Framework? A persistence framework moves the program data in its most natural form (in memory objects) to and from a permanent data store the database. The persistence framework manages the
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.