File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Properties Files vs. JNDI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Properties Files vs. JNDI?" Watch "Properties Files vs. JNDI?" New topic

Properties Files vs. JNDI?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
hi all-
we have a need in our J2EE application to use soft-coded properties (e.g database name etc.) ... what is the best way to do this: JNDI or A ResourceBundle? Oh, some of these are used by EJBs (most of them in fact)
Steve Loughran
Ranch Hand

Joined: Aug 06, 2002
Posts: 37
JNDI is nice for hot update of properties and replication across a cluster -though then you need a replicated directory service.
prop files are simple, but limited in what they can describe.
XML files are in-between; they have more power but are harder to work with.
The java 1.4 preferences API should nominally hide how the preferences are stored, so you could code for anything, but I aint used it yet to be sure.
I agree. Here's the link:
subject: Properties Files vs. JNDI?
It's not a secret anymore!