In my new node, I would like access to a Mysql database (from the NodeModel and from the NodeDialog). To do this, I want to use the Mysql driver already used in a DatabaseConnector node of my workflow.
Currently, I use this code :
String currentDriver = "C:/LOGICIELS/knime_2.4.0/mysql-connector-java-5.1.15-bin.jar";
DatabaseDriverLoader.loadDriver(new File(currentDriver));
String url = "jdbc:mysql://localhost:3306/mydatabase";
con = DriverManager.getConnection(url, "root", "root");
The Mysql connection works except when the DatabaseConnector node is already executed when KNIME is started : in this case the connection fails. I think it is because the DatabaseConnector do not "load" the driver since the DatabaseConnector is already executed...
Could you help me to solve this problem please.