Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using the RMI registry for accessing a DataSource via JNDI ?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
I'd like to access a database (DataSource) via JNDI.
Since I haven't got an LDAP Service or something like that running, I wonder how to do it easily. Do I have to write my own ServiceProvider ? Or would it be a good idea to use the RMI registry for storing my DataSources ??
cheeers
Dennis
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using JNDI doesn't require an LDAP service! All JNDI does is provide a "hook" for a naming service, and a common set of calls for the client side to use that naming service.
The "hook" side is what's known as an SPI, or Service Provider Interface, as you already know; any lookup service can be made "JNDI compliant" through that.
It would be sad if you had to write one for RMI yourself! If you look at Sun's J2EE RI, you'll see it already provides one. Use it in good health!
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, but is there a handy way to store objects in a jndi context, even if I don't use the RMI registry or an LDAP or name service ?
I know JNDI only provides a common interface for all these types of services, but I'm looking for a simple implementation so I can use JNDI to store and retrieve objects, only within my local application.
To say it in a different way, I'd like to have an application-wide object registry, without having to install an LDAP server or so.
 
My, my, aren't you a big fella. Here, have a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!