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.

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.

In short words: JDBC is a 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 objects, it is good to share things among different modules.

Application Servers usually have a JNDI Context for sharing global objects amon different application, Connection Poolers happen to be one of the most clear examples of why sharing via JNDI is good. 

JNDI is the directory that contains the list of objects defined on the server. When the user requests for a connection pool, the code would look for the object on the JNDI and would get the requested connection pool from the data source. 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.

Note: Browse latest  Weblogic interview questions and  Weblogic tutorial. Here you can check  Weblogic Training details and  Weblogic training videos for self learning. Contact +91 988 502 2027 for more information.

All Weblogic Interview Questions

Weblogic Videos

Duration: 20-25 Hours | Version: 12c, 11g | Admin
5999/-
  • Experienced Faculty
  • Real-time Scenarios
  • Free Bundle Access
  • Course Future Updates
  • Sample CV/Resume
  • Interview Q&A
  • Complimentary Materials
Scroll to Top