jndi

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

Hi,

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).

Thanks

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

Ads









Related Tutorials/Questions & Answers:
Version of simple-jndi>simple-jndi dependency
List of Version of simple-jndi>simple-jndi dependency
JNDI names in netbeans
JNDI names in netbeans  how to create a JNDI names in netbeans
Advertisements
Artifacts of simple-jndi
List of Artifacts of simple-jndi maven depenency
Maven Dependency simple-jndi >> 0.10
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.10 in your project
Maven Dependency simple-jndi >> 0.11
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11 in your project
Maven Dependency simple-jndi >> 0.11.1
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11.1 in your project
Maven Dependency simple-jndi >> 0.11.2
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11.2 in your project
Maven Dependency simple-jndi >> 0.11.3
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11.3 in your project
Maven Dependency simple-jndi >> 0.11.4
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11.4 in your project
Maven Dependency simple-jndi >> 0.11.4.1
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.11.4.1 in your project
Maven Dependency simple-jndi >> 0.4
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.4 in your project
Maven Dependency simple-jndi >> 0.5
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.5 in your project
Maven Dependency simple-jndi >> 0.6
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.6 in your project
Maven Dependency simple-jndi >> 0.7
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.7 in your project
Maven Dependency simple-jndi >> 0.7-dev-1
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.7-dev-1 in your project
Maven Dependency simple-jndi >> 0.8
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.8 in your project
Maven Dependency simple-jndi >> 0.8.1
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.8.1 in your project
Maven Dependency simple-jndi >> 0.9
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.9 in your project
Maven Dependency simple-jndi >> 0.9.1
You should include the dependency code given in this page to add Maven Dependency of simple-jndi >> simple-jndi version0.9.1 in your project
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
Version of tmporb>tmporb-ns-jndi dependency
List of Version of tmporb>tmporb-ns-jndi dependency
Version of wsrf>wsrf-jndi-config dependency
List of Version of wsrf>wsrf-jndi-config dependency
Version of com.nervepoint>identity4j-active-directory-jndi dependency
List of Version of com.nervepoint>identity4j-active-directory-jndi dependency
Version of com.nervepoint>identity4j-ldap-directory-jndi dependency
List of Version of com.nervepoint>identity4j-ldap-directory-jndi dependency
Version of wsrf>wsrf-jndi-config-src dependency
List of Version of wsrf>wsrf-jndi-config-src dependency
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
Maven Dependency tmporb-ns-jndi >> 1.0
You should include the dependency code given in this page to add Maven Dependency of tmporb >> tmporb-ns-jndi version1.0 in your project
Maven Dependency wsrf-jndi-config >> 1.0
You should include the dependency code given in this page to add Maven Dependency of wsrf >> wsrf-jndi-config version1.0 in your project
Maven Dependency identity4j-active-directory-jndi >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.nervepoint >> identity4j-active-directory-jndi version1.0.1 in your project
Maven Dependency identity4j-ldap-directory-jndi >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of com.nervepoint >> identity4j-ldap-directory-jndi version1.0.1 in your project

Ads