Jndi (Java naming and Directoryinterface,java naming and directory interfaces) is a set of APIs that access the naming and directory services in a Java application.
The naming service links names to objects so that we can access them by name. A directory service is a naming service in which objects are not only named but also attributes.
/* * Local configuration: Create a new context.xml file under Project Meta-info <br/> * Jndi (Java naming and * directoryinterface, The Java naming and directory interface) is a set of APIs that access the naming and directory services in a Java application. <br/> * Naming Service links names to objects so that we can access them by name. A directory service is a naming service in which objects are not only named but also attributes. <br/> * * new initialcontext () ; = (DataSource) CT . Lookup ("java:comp/env/jdbc/test_jndi_oracle" ); System. out. println (Ds.getconnection ());
Jndi Configuration Data source