Driver is incompatible with the current JVM version or processor architecture
DataGrip and a JDBC driver interact with each other in separate processes: the IDE runs in one process, the driver in another. Two separate processes secure the stability of the IDE work. Otherwise, a memory leak or an error that leads to a failure in the JDBC driver will also influence the IDE. In our case, a failure in the JDBC driver will happen only in its process and will not affect the IDE process.
Both processes use a Java Virtual Machine (JVM) to work. In DataGrip, you can separate and use different JVM versions for the driver's process and for the process of the IDE. Consider the following situations.
The
java.xml.bind
module was removed from JDK 11. But some drivers depend on this module. To fix the issue, you can run the driver's process with JVM 8 that includes the missing module.A driver might have native libraries only for the x86 architecture and no libraries for x64. In this situation, you can fix the issue by setting JVM x86 for the driver's process.
Some drivers miss native libraries for aarch64 and thus do not work on the aarch64 architecture. As a workaround, you can set JVM for a different processor architecture (for example, x64). In this case, the native library for x64 will be used (if it exists in the driver).
Step 1. Change the JVM version for the driver's process
Open data source properties. You can open data source properties by using one of the following options:
Navigate to
.Press Control+Alt+Shift+S.
In the Database Explorer Command 1 ( ), click the Data Source Properties icon ().
In the Data Sources and Drivers dialog, click the driver for which you want to use a different JVM version and select Duplicate. Alternatively, press Control+D.
In the Name field, type the driver's name and the JVM version that you want to use (for example,
Snowflake Java 11 x64
).Click the Advanced tab.
From the VM home path list, select the JVM version that you want to use. Alternatively, click the Browse icon (), and navigate to the JVM directory on your hard drive.
Step 2. Select the modified driver for a data source
Open data source properties. You can open data source properties by using one of the following options:
Navigate to
.Press Control+Alt+Shift+S.
In the Database Explorer Command 1 ( ), click the Data Source Properties icon ().
In the Data Sources and Drivers dialog, click the Add icon () and select the driver that you modified on Step 1 (in our case, Snowflake Java 11 x64).
Alternatively, if the data source is created. Click the Driver link and select the driver.
Specify the database connection details. Alternatively, paste the JDBC URL in the URL field.
To delete a password, right-click the Password field and select Set Empty.
Ensure that the connection to the database can be established using the provided details. To do that, click the Test Connection link at the bottom of the connection details area.
In case of any connection issues, refer to the Cannot connect to a database page.
Native libraries
To support different processor architectures, the driver might include native libraries. These libraries, as well as the driver itself, depend on the JVM version that you use. By default, drivers use the same JVM version as the IDE. The following screenshot shows a list of native libraries in a driver.