JDBC is slight similar to JNDI because they are both OO Java API. The JNDI is mostly used for accessing a native interface while the JDBC is more on relational database. You can use JDBC without JNDI or you can use both. Based on your question, the JNDI, JDBC and DataSource can be used together for a purpose. Based on my previous project I used bought because it is part of the technical requirements and I implemented it through Web XML and on my other project I used the Spring Configuration.
The JNDI part was stored on WebSphere variable, so I used the JNDI to call it. The datasource is created on the WebSphere DB connection and the JDBC is my driver or connector type. In WebSphere you can use any type of JDBC, but on my project I used JDBC type 2 because I don't need advance features which is on JDBC type 4.
DataSource reference by JDBC and JDBC can be called by JNDI. For simplistic way: JNDI ( JDBC (DATASOURCE)))
This is just my thought.
ReAch yOur GoAl wHile U hAve tImE.
OptImiZe and MaXiMize ResourCes whILe It is sTiLL FrEe
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
a bit of art, as a gift, that will fit in a stocking