Skip to content

Commit

Permalink
Fix for creating a teiid JDBC connection profile
Browse files Browse the repository at this point in the history
* Appears that the Teiid JDBC Connection class is unable to find the teiid
  driver using the given class loader.

* By depending on the teiid plugin and using the class' own classloader it
  is possible to find the TeiidDriver class
  • Loading branch information
Paul Richardson committed Aug 30, 2012
1 parent b099b76 commit eb24b26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.103.0,4.0.0)",
org.eclipse.datatools.connectivity.sqm.core;bundle-version="[1.2.5,2.0.0)",
org.eclipse.datatools.sqltools.parsers.sql;bundle-version="[1.0.2,2.0.0)",
org.eclipse.datatools.connectivity.sqm.server.ui;bundle-version="[1.1.100,2.0.0)",
org.teiid.datatools.connectivity.model;bundle-version="[8.0.0,9.0.0)"
org.teiid.datatools.connectivity.model;bundle-version="[8.0.0,9.0.0)",
teiid_embedded_query;bundle-version="8.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.datatools.modelbase.dbdefinition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,17 @@ protected Object createConnection( ClassLoader cl ) throws Throwable {
addPairs = addPairs + pairs[i];
}
}

Driver jdbcDriver = (Driver)cl.loadClass(driverClass).newInstance();

Driver jdbcDriver = null;
try {
jdbcDriver = (Driver)cl.loadClass(driverClass).newInstance();
}
catch (Exception ex) {}

if (jdbcDriver == null) {
jdbcDriver = (Driver)this.getClass().getClassLoader().loadClass(driverClass).newInstance();
}

return jdbcDriver.connect(connectURL, connectionProps); // return super.createConnection(cl);
}

Expand Down

0 comments on commit eb24b26

Please sign in to comment.