right now I'm writing a program in Java that will be plugged into an existing application as a plugin. I want to use JDBI in my plugin (as it is very comfortable and I'm used to it) and need to connect to a MySQL database.
Usually that works fine after including the driver, but there is a problem with the existing application. Obviously it already has a mysql-driver, but an obsolete one.
That causes errors and makes it impossible to send a query to the database. (The error is known: The old driver has deprecated methods that cannot be used with the new MySQL versions)
I thought shading my jar would help (I'm using maven) but the error still occurs. But I know the shaded name of my driver, I only need to know how to load it so JDBI will make use of it. Right now I have something like this:
Class.forName("myapp.mysql.jdbc.Driver").newInstance();
DBI dbi = new DBI(String.format("jdbc:mysql://localhost/test", username, password);
What do I have to do to tell jdbi it must use myapp.mysql.jdbc.Driver
?