Skip to content

Commit

Permalink
Fix for wocommunity#1009: for the mySQLPlugin, the driver class is no…
Browse files Browse the repository at this point in the history
…w automatically registered via the SPI.
  • Loading branch information
renebock committed Jan 31, 2023
1 parent bd44b6c commit 7263c76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,13 @@ public void freeConnection(Connection conn) {

private Connection createConnection() throws SQLException {
try {
Class.forName(dbDriver);

// When dbDriver null or blank, the driver is automatically registered via the SPI.
// Manual loading of the driver class is generally unnecessary.
if(dbDriver != null && !dbDriver.isEmpty()) {
Class.forName(dbDriver);
}

Connection conn = DriverManager.getConnection(dbServer, dbLogin, dbPassword);
return conn;
} catch (ClassNotFoundException e2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public class _MySQLPlugIn extends JDBCPlugIn {

private static final String DriverClassName = "com.mysql.jdbc.Driver";
private static final String DriverClassName = null;

private static final String DriverProductName = "MySQL";

Expand Down

0 comments on commit 7263c76

Please sign in to comment.