I cant load java.sql.SQLException class into my IKVM
Brought to you by:
jfrijters
How I can load java.sql.SQLException class into my IKVM?
I have the follow code in C#:
string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); string pathJarTeiidConnector = path + "\\JARs\\TeiidConnector.jar"; /*ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("gson-2.8.0.jar")); ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("jdbc-api-1.4.jar")); ikvm.runtime.Startup.addBootClassPathAssemby(Assembly.Load("teiid-9.1.1-jdbc.jar"));*/ java.net.URL url = new java.net.URL(pathJarTeiidConnector); // Create an array of all URLS java.net.URL[] urls = { url }; // Create a ClassLoader loader = new java.net.URLClassLoader(urls); try { java.lang.Class.forName("java.sql.SQLException", true, loader); // <======================================== Trying this... but doesnt work // load the Class cl = java.lang.Class.forName("TeiidConnector.Main", true, loader); Type type = ikvm.runtime.Util.getInstanceTypeFromClass(cl); method = type.GetMethod("execute", BindingFlags.Public | BindingFlags.Static); } catch(Exception e) { throw e; // <============================ Throws this exception [ClassNotFoundException: java.sql.SQLException] }