Updated on 2023-11-21 GMT+08:00

Driver Package and Environment Dependency

GeminiDB Mongo allows you to perform operations using Java. In this way, you can connect to an instance through an SSL connection or an unencrypted connection. The SSL connection encrypts data and is more secure.

SSL is disabled by default for a new GeminiDB Mongo instance. To enable SSL, see Enabling SSL.

Installing the Driver

  1. Click the JAR driver download address to download mongo-java-driver-3.12.9.jar, which provides APIs for accessing GeminiDB Mongo instances.
  2. To install the driver, see the official guide.

Environment

JDK 1.8 must be configured for the client. JDK is cross-platform and supports Windows and Linux.

The following uses Windows as an example to describe how to configure JDK:

  1. In the DOS window, run java -version to check the JDK version. Ensure that the JDK version is 1.8. If JDK is not installed, download the installation package and install it.
  2. Right-click the This PC icon on the desktop of the Windows OS and choose Properties from the shortcut menu.
  3. In the System window, click Advanced system settings in the navigation tree on the left.
  4. In the dialog box that is displayed, click Environment Variables.
  5. In the displayed window, set the variables listed in the following table.

    Variable

    Operation

    Value

    JAVA_HOME

    • If this parameter exists, click Edit.
    • If this parameter does not exist, click New.

    Java installation directory.

    For example, C:\Program Files\Java\jdk1.8.0_131.

    Path

    Click Edit.

    • If JAVA_HOME is configured, add %JAVA_HOME %\bin to the beginning of the variable value.
    • If JAVA_HOME is not configured, add the following Java installation path before the variable value.

      C:\Program Files\Java\jdk1.8.0_131\bin;

    CLASSPATH

    Click New.

    .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;

  6. Click OK and close the windows in sequence.