|
Java™ by example!
|
|
|
How do I store a Java object in a file on the local file system using JNDI?
You can bind an object into a context, provided your object is a Reference or implements the Referenceable interface. The object is stored in a file called .bindings as a set of properties. The following example shows how to store the object Member containing two Strings username and email. Write.java:
Member.java:
MemberFactory.java:
The .bindings file, located in c:\temp looks like a simple properties file:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|