S
Steve Menard
I am having problems calling JDBC code from C/C++ via JNI.
I am embedding the JVM, and need access to any JDCB driver.
My problem is the following :
I can get the driver registered no problem, but when it comes time to
try and connect, the DriverManager "skips" over it because the driver's
ClassLoader is not the same as the caller's ClassLoader.
Now, I am calling this from C/C++ code, so there is no caller class, and
so no caller classloader.
I can make it work by bypassing th DriverManager completely, and asking
the driver to connect itself. That's fine as a stopgap solution, but I
would really like to fix this. The same problem occurs when I call
Class.forName(String), as this method looks at the caller's class and
classloader.
Is there a way to set or simulate a current class and/or classloader?
thanks in advance,
Steve
I am embedding the JVM, and need access to any JDCB driver.
My problem is the following :
I can get the driver registered no problem, but when it comes time to
try and connect, the DriverManager "skips" over it because the driver's
ClassLoader is not the same as the caller's ClassLoader.
Now, I am calling this from C/C++ code, so there is no caller class, and
so no caller classloader.
I can make it work by bypassing th DriverManager completely, and asking
the driver to connect itself. That's fine as a stopgap solution, but I
would really like to fix this. The same problem occurs when I call
Class.forName(String), as this method looks at the caller's class and
classloader.
Is there a way to set or simulate a current class and/or classloader?
thanks in advance,
Steve