[jOOQ/jOOQ#9506] Explicit loading of the JDBC driver, if available

This commit is contained in:
Lukas Eder 2023-06-16 15:41:00 +02:00
parent b60b5c524b
commit d334f61aa3
2 changed files with 4 additions and 0 deletions

View File

@ -163,6 +163,9 @@ abstract class AbstractMigrationsMojo extends AbstractMojo {
if (jdbc == null || jdbc.url == null)
throw new MojoExecutionException("JDBC URL is required");
if (jdbc.driver != null)
Class.forName(jdbc.driver);
try (CloseableDSLContext ctx = DSL.using(jdbc.url, defaultIfNull(jdbc.user, jdbc.username), jdbc.password)) {
// Initialise Settings

View File

@ -39,6 +39,7 @@ package org.jooq.codegen.maven;
public class Jdbc {
public String driver;
public String url;
public String user;
public String username;