What is the Difference Between JNDI and JDBC

Question: What is the Difference Between JNDI and JDBC?

Answer: JDBC is java database API, while JNDI is java native directory API. (What is the Difference Between JNDI and JDBC)

The main thing in here is that in a JNDI directory you’re actually storing a JDBC DataSource, so, you’re simply using JDBC and obtain a Connection via JNDI lookup. (Company)

In short words: JDBC is Database realm, JNDI lets you store Objects in a virtual context (the Directory) that can be local, remote (Implementation details usually don’t matters).

You access this context via names, obtaining stored (salesforce online training) objects, is good to share things among different modules.  (Virtual Hosting in Apache)

Application Servers usually have a JNDI Context for sharing global objects amon different application, Connection Poolers happen to be one of the most clear example of why sharing via JNDI is good. (Define 1 connection pooler, share between several webapps)

JNDI is the directory which contains the list of objectsdefined on the server. When the user requests for a connection pool, the code (pivotal training) would look for the object on the JNDI and would get the requested connection pool from the datasource. JDBC is the one which does all the interactions with the database. An application will lookup the JNDI to get a connection pool for it to interact with the database.

SVR offers Weblogic Training with these facilities:


Click here To Get Free Access to 50+ Weblogic Tutorial Videos