Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Is there a way to list and instance drivers?
AIMMOTH
Hello,
how do you instance a driver suited for web services? The package org.eclipse.datatools.enablement.oda.ws is closed (see the manifest).
Is there a way to list the loaded drivers and then use one of them for your data set ui? It would be nice not to create a driver from scratch when it's allready done.
For me, it would be create to get an instance of org.eclipse.datatools.enablement.oda.ws.impl.Driver. Later I would create a data set ui.
Thanks
Carl
Find more posts tagged with
Comments
JasonW
You could always check out the source and modify it. You could always change the manifest as well. May be a good idea to log an enhancement request to open it up.
Jason
AIMMOTH
Thank you Jason,<br />
<br />
it worked!<br />
<br />
Problem: I needed the web service drivers and ui wizard. But the plug-ins have only one export package (org.eclipse.datatools.enablement.oda.ws.api).<br />
<br />
Solution:<br />
<br />
<ul class='bbcol decimal'><li>Unpack the two jars (org.eclipse.datatools.enablement.oda.ws.*.jar), one is for the driver and one is for the ui (wizards etc).</li><li>Edit the ui manifest and add in "Export-Package:": <strong class='bbc'>org.eclipse.datatools.enablement.oda.ws.ui.wizards</strong>", in the driver manifest you add to "Export Package": <strong class='bbc'>org.eclipse.datatools.enablement.oda.ws.impl</strong></li><li>Recreate the jars with "<strong class='bbc'>jar cfm META-INF\MANIFEST.MF plugin.xml plugin.properties META-INF org</strong>" (don't forget the directory "<strong class='bbc'>icons</strong>" in the ui jar).</li><li>Then, backup the two original jars from eclipse\plugin and move your two jars to the folder.<em class='bbc'><strong class='bbc'>Important: Rename your jars to the original names!</strong></em></li><li>Restart Eclipse and in your plugin, import any packages you need in your plugin.xml editor.</li></ul>
AIMMOTH
There is also a way to list some of the drivers (don't know which one) with this code:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>DriverManager instance = DriverManager.getInstance();
for (DriverInstance driver : instance.getAllDriverInstances()) {
try {
System.out.println("id:" + driver.getId() + ", name:" + driver.getName() +
", class loader:" + driver.getClassLoader() + ", template:" + driver.getTemplate().getName());
} catch (Exception e) {
e.printStackTrace();
}
Properties baseProperties = driver.getPropertySet().getBaseProperties();
for (Object o : baseProperties.keySet()) {
System.out.println("base property:" + o);
}
}</pre>