Referencing LDAP for JDBC thin client connections….

Just a quick note, to mention something that I just recently discovered.  (Yes, this has been available since at least Oracle 10.1, but I wasn’t aware of it!)

When composing a JDBC thin client connect URL, we have been using something of the form:

This is fine, but if you have a mix of Oracle OCI clients and JDBC thin clients, and if the OCI clients are all configured to use an LDAP server for Net Service Name resolution, then, whenever you make any kind of reconfiguration, you need to update the LDAP server, and then still need to update the hardcoded connection information in the JDBC Thin URL.

However, what i recently discovered, is that it’s possible to define your JDBC Thin URL, thus:


So, now, the JDBC Thin connection will refer to the LDAP server for info on the ‘mydb’ connect string, and the LDAP server will return:


And now, when I update my centrally managed LDAP server, it’s seen by all my JDBC Thin clients as well as OCI clients.

So, yes, this has been around for many years, but I wasn’t aware of it. I’m sure you, my readers, are much sharper than I, and have known about it all along, and are saying “So, what’s new? What’s he going on about?” But, perhaps there are one or two that were not aware of this, so, I hope this little mini-blog entry helps someone out!

Thanks to Fred for this comment on my OpenLDAP blog post, that brought this to light for me:


2 comments on “Referencing LDAP for JDBC thin client connections….

  1. Simon Kitching says:

    Thanks very much – I was very puzzled by receiving an “ldap” address for an oracle address from a client, and was very glad to find your explanation.

  2. Also you can check more options to oracle jdbc urls in official documentation

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s