Docs Home → Develop Applications → MongoDB Drivers → Java Sync
Connect to MongoDB Using a JNDI Datasource![](/zh-cn/docs/drivers/java/sync/v4.5/assets/link.svg)
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![](/zh-cn/docs/drivers/java/sync/v4.5/assets/link.svg)
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.