Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Connect to Oracle 8 via JNI hangs
I'm using the Java Native Interface to call a C shared library (Pro*C)
which makes a database connection. The connection hangs. Why?
I'm on HP-UX 11.00 E 9000/810 (t11) and Oracle 8.0.4 with Java JDK 1.1.7b
So what files do I have?
APITest.java - a java source file with a couple of public native methods APITest.h - Generated using "javah -jni APITest" APITest.c - a small C stub which calls my oracle shared libraryDB.pc - the Pro*C file with the database calls
So when I run the java file, it calls a native function "DBConnect" in APITest.c (which I've compiled into a shared libary libAPITest.sl). This now calls a function called "db_connect" in another shared library, which was created from DB.c (after compiling DB.pc -> DB.c)
The "exec sql connect :oracleid;" line in DB.pc is called and there it hangs.
The answer? Use native_threads NOT green_threads
Once I changed to native_threads the sql connect call returned succesfully, and I decided to RTFM to see why.
I couldn't see anyone else having this problem, so maybe I'm the only one. Let me know if anyone knows where I can find good information about Java threads and Oracle 8.
Cheerio
Dave
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Wed Jun 09 1999 - 12:33:14 CDT
![]() |
![]() |