Maven and Gradle JDBC Drivers for Various Databases

Maven:

1. MySQL:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.23</version> <!-- Use the latest version -->
</dependency>

2. Oracle:

<dependency>
    <groupId>com.oracle.database.jdbc</groupId>
    <artifactId>ojdbc8</artifactId>
    <version>19.11.0.0</version> <!-- Use the latest version -->
</dependency>

3. PostgreSQL:

<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.20</version> <!-- Use the latest version -->
</dependency>

4. Microsoft SQL Server:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>9.4.0.jre11</version> <!-- Use the latest version -->
</dependency>

5. SQLite:

<dependency>
    <groupId>org.xerial</groupId>
    <artifactId>sqlite-jdbc</artifactId>
    <version>3.36.0</version> <!-- Use the latest version -->
</dependency>

6. DB2:

<dependency>
    <groupId>com.ibm.db2.jcc</groupId>
    <artifactId>db2jcc</artifactId>
    <version>4.29.24</version> <!-- Use the latest version -->
</dependency>

Gradle:

1. MySQL:

implementation 'mysql:mysql-connector-java:8.0.23' // Use the latest version

2. Oracle:

implementation 'com.oracle.database.jdbc:ojdbc8:19.11.0.0' // Use the latest version

3. PostgreSQL:

implementation 'org.postgresql:postgresql:42.2.20' // Use the latest version

4. Microsoft SQL Server:

implementation 'com.microsoft.sqlserver:mssql-jdbc:9.4.0.jre11' // Use the latest version

5. SQLite:

implementation 'org.xerial:sqlite-jdbc:3.36.0' // Use the latest version

6. DB2:

implementation 'com.ibm.db2.jcc:db2jcc:4.29.24' // Use the latest version

Note: Replace the version numbers in the dependencies with the latest versions available on Maven Central or the respective repositories for accurate and up-to-date libraries.

Last updated