Docs Home → Develop Applications → MongoDB Drivers → Java
Connect to MongoDB Using a JNDI Datasource
On this page
This version of the documentation is archived and no longer supported. View the current documentation to learn how to upgrade your version of the Java Sync Driver.
Overview
In this guide, you can learn how to connect the MongoDB Java driver to your MongoDB instance using a Java Naming and Directory Interface (JNDI) Datasource.
MongoClientFactory includes a JNDI
ObjectFactory
implementation that returns MongoClient
instances
based on a connection URI. Consult the following
guides to learn how to configure your application to connect using a
JNDI Datasource.
Tip
See also:
For JNDI implementations other than those listed here, you can create
your own Factory
wrapper based on the driver's built-in
MongoClientFactory
implementation.