I have added the oracle driver ojdbc6.jar in Preferences->KNIME->Databases. I did this in the sdk itself and then when testing my node in the KNIME perspective I had to add it again.
However I get an exception that no suitable driver is found for my connection string and this means that the oracle driver is not loaded at all. I verfied this with
which throws a ClassNotFoundException.
How can I load and use this driver in my node automatically?
You need to register the driver in the KNIME instance that you start from within the SDK.
Yes I did that. That is what I mean with:
I did this in the sdk itself and then when testing my node in the KNIME perspective I had to add it again.
How am i supposed to open a connection? Using DriverManager?
Below code shows that Oracle driver is not available in DriverManager:
Enumeration<Driver> drivers = DriverManager.getDrivers();
Driver driver = drivers.nextElement();
The (undocumented) solution is:
Ary our refering to the KNIME perspective in the KNIME SDK? You need to start an new KNIME application from the SDK, not just switch the perspective in the SDK.
KNIME registers all drivers found in all Jar files registered in the preferences. So you should not need to register it manually.
I start a new istance through the Run menu in the SDK via the run configuration. Is that correct?