There is a JDBC Driver in settings of plugin DBNavigator and inside these settings everything is ok as shown on screen. Database is connecting using this plugin without any isssue. But when I try to make a connection I receive SQLException.
Here is the code
public class TestDB {
private final static String uName = "root";
private final static String uPass = "root";
private final static String sqlUrl = "jdbc:mysql://localhost:3306/mydbtest";
public static void main(String[] args) {
try (Connection connection = DriverManager.getConnection(sqlUrl, uName, uPass)) {
System.out.println("Connected");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
I tried to configure path to JDBC Driver in plugin manually but it didn't change anything. I still receive SQLexcepption.
I've read also that it is possible to copy *jar file of driver to classpath. But why do I have to do this if such driver has already installed in DBNavigator? The question is whether it somehow would be working in this configuration only with plugin?
In case it wouldn't be working like that, what should I do to fix it?