Share on Google+Share on Google+

2 Answer(s)      6 years and 8 months ago
Posted in : JNDI
can u please tell me about jndi, what purpose we use jndi, is it like jdbc,hibernate?
View Answers

October 4, 2010 at 8:25 PM


The Java Naming and Directory Interface (JNDI) is provides the API for accessing the multiple naming and directory services. This API enables the programmers to store and retrieve the java objects of any types.

The JNDI api also enables the Java programmers to access existing naming and directory services, such as LDAP, NDS, DNS, and NIS(YP).


April 5, 2011 at 11:47 AM

hi, jndi is an api which provides a connection object to the programmer . by using jndi we can get the connection and the connection and given to the server. actually server maintain a connections which will call it a connectionpooling mechnisam. this type connection use jdbc to access the connection. we no need to write the Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con=DriverManager.getConnection(url,username,password); this logic we just configure the following structure

if it is apache server:

Context context=new InitialContext();

DataSource datasouce=(DataSource)context.lookUp("java:comp/env/JndiName");

Connection con=datasource.getConnection()

it will provide the connection

if it is weblogic server

Context context=new InitialConntext()

ht.put(Context.INITIALCONTEXTFACTORY, "weblogic.jndi.WLInitialContextFactory");

ht.put(Context.PROVIDER_URL, "t3://localhost:7001");

DataSource datasouce=(DataSource)context.lookUp(ht);

Connection con=datasource.getConnection() it will provide the Connection object

and also one more answer the question it is like jdbc,hibernate jdbc uses the jdni, which provide a connection Hibernate is orm tool .hibernate is internaly use the jdbc api which will genarate the querys,prepate the connection object s


Related Tutorials/Questions & Answers:
JNDI - Whats the use of jndi?  Whats the use of jndi? can we change the jndi according to our needs
jndi - JNDI
jndi  can u please tell me about jndi, what purpose we use jndi... (JNDI) is provides the API for accessing the multiple naming and directory... of any types. The JNDI api also enables the Java programmers to access existing
JNDI  Explain JNDI in detail?  Hi friend, JNDI (Java Naming and Directory Interface) enables Java platform-based applications... application programming interface (API) set, JNDI makes it possible for developers
Java - JNDI
Java  What is jndi and where it is exactly used?  Hi Friend, Please visit the following link: http://www.roseindia.net/help/java/c/jndi-context.shtml http://www.roseindia.net/help/java/i/jndi.shtml Hope
Java - JNDI
Java  What is JNDI name & why we use this  Hi friend, 1)JNDI(Java Naming and Directory Interface) is part of the Java platform. 2..., JNDI, LDAP, Active Directory System Level -> File System (DOS, NTFS, etc
JNDI names in netbeans
JNDI names in netbeans  how to create a JNDI names in netbeans
JNDI Settings in EJB3.0 - EJB
JNDI Settings in EJB3.0  Dear frieds, How to setup & use JNDI in ejb3.0 Johns Abraham
Application Server - JNDI
Application Server  How can we create Domain in Weblogic9.1 application server and also how can we create jdbc connection pooling by using oraclethin driver and how can we configure it to jndi
hibernate jndi
In this section, you will learn about configuring hibernate to connect to database via JNDI datasource
JNDI Context
JNDI Context        Like JDBC (Java Database Connectivity), JNDI is not a service, but a set... an environment-naming context that can be accessed using the JNDI API. It also
Registering DataSource with JNDI
; } Registering The DataSource With JNDI Java Naming Directory Interface (JNDI) Java Naming Directory Interface (JNDI) is an API of java technology which... using Java Object Model for java applications. With the name of JNDI java
EJB JNDI LOOK UP PROBLEM  Hi, I am using jboss4.2 and created a sessionbean using EJB3 but while running client code I am finding NoInitialContextException claname not set in enviornment properties
Java Naming and Directory Interface (JNDI)
Java Naming and Directory Interface (JNDI)       The Java Naming and Directory Interface (JNDI... and objects via a name. JNDI is independent of the underlying implementation
java - Java Beginners
java  JNDI Configuration tomcat using eclipse
cofigurations - Java Beginners
cofigurations  what configurations i have to do for Tomcat5.5 and Eclipse3.x for database connection using JNDI
Explain - LDAP
Explain LDAP  Any one explain about LDAP ? and also explain about JNDI what relation b/w this two
Given a list of methods for a stateful or stateless session bean class, define which of the following operations can be performed from each of those methods: SessionContext interface metho
methods, Java Naming and Directory Interface API (JNDI API) access to java..., UserTransaction methods, Java Naming and Directory Interface API (JNDI API.... JNDI access to java:comp/env
mahesh  I developed a sessionbean in netbeans IDE..bt ejb-jar.xml is not available in netbeans how can i map jndi name to ejb without ejb-jar.xml. am using bea-weblogic application server. please can anybody help
Advance Java
Advance Java  Context ctx = new InitialContext(); if(ctx==null) { throw new RuntimeException("JNDI Context not Found"); } ds=(DataSource)ctx.lookup
Building Enterprise Bean Perspective to Allow Access
injection or JNDI lookup. Through Dependency Injection javax.ejb.EJB annotation... : @EJB XYZBean xyzBean; Through JNDI lookup, lookup method... the dependency injection or JNDI lookup. Through Dependency Injection javax.ejb.EJB
Difference between EJB 2 and EJB 3 - EJB
That is the clientClass using the JNDI name looks for appropriate bean and operates. where... for the JNDI name in the appropriate jar..  Hi Friend, Please visit
j2ee - EJB
j2ee  how can u make a call from session Bean of SessionFacade to Entity Bean when ur using persistence logic implemented in Entity Beans. I think inorder to get the home interface obj for first time it will look up in jndi
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..
(); Class.forName( aProps.getProperty("driver") ); String JNDI = aProps.getProperty("JNDI_NAME"); try... = (DataSource) ictx.lookup(JNDI); mCon = ds.getConnection
Understanding Data Source
on. DataSource object works with JNDI (Java Naming and Directory interface) naming service so application can use the JNDI API to access
Java - JMS
the localjndi name is mapped to the remote Que's connectionfactory\Queue jndi name... to the LocalJNDI name (which in turn maps to the remote queue jndi name). The message I