[CONJ-779] Logic error in stop() method of OSGi bundle activator Created: 2020-04-08  Updated: 2020-06-22  Resolved: 2020-06-22

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.6.0
Fix Version/s: 2.6.1

Type: Bug Priority: Minor
Reporter: Domagoj Cosic Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

The code

    if (DriverManager.getDriver("jdbc:mariadb:") != null) {
      SchedulerServiceProviderHolder.close();
    }

assumes that getDriver returns null if the driver is not found. It does not, it never returns null. It throws a SQLException with message "No suitable driver" and error code 08001.
Please replace by a try-catch clause.



 Comments   
Comment by Diego Dupin [ 2020-06-22 ]

done with commit https://github.com/mariadb-corporation/mariadb-connector-j/commit/f0e4180f25faa3b624dc05e74f6d9559ed194ef7

Generated at Thu Feb 08 03:18:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.