The Java Naming and Directory Interface is an API to access different naming and directory services. You use it to access something stored in a directory or naming service without haveing to code specifically to that naming or directory service.
Java DataBase Connectivity API is an API to access different relational databases. You use it to access relational databases without embedding a dependency on a specific database type in your code.