[CONJ-423] Permit to have MySQL driver and MariaDB driver in same classpath Created: 2017-02-03  Updated: 2017-03-03  Resolved: 2017-02-09

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: None
Fix Version/s: 2.0.0-RC, 1.5.9

Type: Task Priority: Minor
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of CONJ-421 Spark error: java.sql.SQLException: O... Open

 Description   

MariaDB driver accept connection string begining with "jdbc:mariadb:" and "jdbc:mysql:".
so when DriverManager call registred driver for an url, if MySQL driver is in classpath, Driver will randomly return a MySQL or MariaDB Driver.

Goal is to permit having MariaDB and MySQL driver are in same classpath for good reason (testing, benchmark, ...).

Driver.acceptsUrl(String url) must return false for connection string beginning with "jdbc:mysql" AND containing "disableMariaDbDriver".

So when MySQL AND MariaDB drivers are on same classpath, DriverManager.getConnection("jdbc:mysql://localhost/db?user=root&disableMariaDbDriver") will always return a connection using MySQL driver


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