1
1
.. _java-language-center:
2
2
3
- .. include:: /includes/unicode-checkmark.rst
4
-
5
- ===================
6
- Java MongoDB Driver
7
- ===================
3
+ ====================
4
+ Java MongoDB Drivers
5
+ ====================
8
6
9
7
.. default-domain:: mongodb
10
8
11
9
.. contents:: On this page
12
10
:local:
13
11
:backlinks: none
14
12
:depth: 1
15
- :class: twocols
16
13
17
14
Introduction
18
15
------------
19
16
20
- The official MongoDB Java Driver providing both synchronous and asynchronous interaction with MongoDB.
21
-
22
- - :java-docs:`Reference Documentation <driver/>`
23
-
24
- - :java-docs:`Tutorials <driver/tutorials/>`
25
-
26
- - :java-docs:`API Documentation <apidocs/>`
27
-
28
- - :java-docs:`What's New <whats-new/>`
29
-
30
- - `Source Code <https://github.com/mongodb/mongo-java-driver/>`__
17
+ `Java Driver <https://docs.mongodb.com/drivers/java/sync/current>`__ is the recommended MongoDB Java Driver.
31
18
19
+ For asynchronous stream processing and reactive streams interoperability,
20
+ the :doc:`Reactive Streams Driver </reactive-streams>` is the
21
+ recommended MongoDB Java Driver.
32
22
33
23
Take the free online course taught by MongoDB
34
24
---------------------------------------------
@@ -44,60 +34,3 @@ Take the free online course taught by MongoDB
44
34
Learn the essentials of Java application development with MongoDB.
45
35
46
36
47
- Installation
48
- ------------
49
-
50
- The recommended way to get started using one of the drivers in your project is with a dependency
51
- management system. See the :java-docs:`Installation Guide <driver/getting-started/installation/>`
52
- for more information.
53
-
54
-
55
- Connect to MongoDB Atlas
56
- ------------------------
57
-
58
- .. include:: /includes/atlas-connect-blurb.rst
59
-
60
- .. code-block:: java
61
-
62
- import com.mongodb.ConnectionString;
63
- import com.mongodb.client.MongoClients;
64
- import com.mongodb.client.MongoClient;
65
- import com.mongodb.client.MongoDatabase;
66
- import com.mongodb.MongoClientSettings;
67
-
68
- // ...
69
- ConnectionString connString = new ConnectionString(
70
- "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority"
71
- );
72
- MongoClientSettings settings = MongoClientSettings.builder()
73
- .applyConnectionString(connString)
74
- .retryWrites(true)
75
- .build();
76
- MongoClient mongoClient = MongoClients.create(settings);
77
- MongoDatabase database = mongoClient.getDatabase("test");
78
-
79
- .. include:: /includes/serverless-compatibility.rst
80
-
81
- See :java-docs:`Connect to MongoDB <driver/tutorials/connect-to-mongodb/>`
82
- for more ways to connect.
83
-
84
- Compatibility
85
- -------------
86
-
87
- MongoDB Compatibility
88
- ~~~~~~~~~~~~~~~~~~~~~
89
-
90
- .. include:: /includes/mongodb-compatibility-table-java.rst
91
-
92
- .. include:: /includes/older-server-versions-unsupported.rst
93
-
94
- Language Compatibility
95
- ~~~~~~~~~~~~~~~~~~~~~~
96
-
97
- .. include:: /includes/extracts/java-driver-compatibility-matrix-language.rst
98
-
99
- .. include:: /includes/language-compatibility-table-java.rst
100
-
101
- .. include:: /includes/about-driver-compatibility.rst
102
-
103
- .. include:: /includes/help-links-java.rst
0 commit comments