Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java, oracle on NT

 
javahelp
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have compiled program which is using Oracel drive to connect to oarcle database sitting on solaris. When i try to run the program i am getting following error.
Can some one hwlp me.
Thanks
C:\javawork>java Employee
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1290)
at java.lang.Runtime.loadLibrary0(Runtime.java:473)
at java.lang.System.loadLibrary(System.java:777)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Employee.main(Employee.java, Compiled Code)
C:\javawork>
 
narayan kulkarni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the problem is probably with classpath
Check out with the classpath
Regards
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is your PATH, not CLASSPATH. Make sure your PATH contains the path to ocijdbc8.dll. In my installation, it is located in c:\Oracle\Ora81\bin
 
javahelp
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Hildner:
I think this is your PATH, not CLASSPATH. Make sure your PATH contains the path to ocijdbc8.dll. In my installation, it is located in c:\Oracle\Ora81\bin

Yes my path and class paths are as followsC:\javawork>echo %path%
C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\WBEM;c:\jdk1.2.2\lib;c:\jdk1.2.2\bin;c:\jdk1.2.2;c:\tomcat\jakarta-tomcat-3
.2.1\bin;c:\tomcat\jakarta-tomcat-3.2.1\lib;c:\orant\oci8\jdbc\lib;c:\;c:\dos;c:\sunpc
C:\javawork>echo %classpath%
c:\orant\oci8\jdbc\lib\classes12.zip;c:\jdk1.2.2\bin;c:\tomcat\jakarta-tomcat-3.2.1\bin;c:\tomcat\jakarta-tomcat-3.2.1\lib
still it doesn't work
 
narayan kulkarni
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I used to encounter this sort of error I used to unzip the classes111.zip or classes*.zip and then put the resulting directory path in the classpath.
I usually used to extract classes.zip to in my webserver root directory
I am rusted because I am now not working in Java for 9 months
I canot tell you the exact classpath
so i think you can give this a try
Regards
Narayan
 
Seema Shetty
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For jdk1.2 and above, it is the path or classpath is not set for classes12.zip.If it is jdk1.1 and below, you should go for classes111.zip.
You should include the classpath upto the file zip file level like below.
C:\Oracle\Ora81\jdbc\lib\classes12.zip.
Good luck.
Mamta
Originally posted by javahelp:
I have compiled program which is using Oracel drive to connect to oarcle database sitting on solaris. When i try to run the program i am getting following error.
Can some one hwlp me.
Thanks
C:\javawork>java Employee
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1290)
at java.lang.Runtime.loadLibrary0(Runtime.java:473)
at java.lang.System.loadLibrary(System.java:777)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Employee.main(Employee.java, Compiled Code)
C:\javawork>

 
suren
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had this problem on one of the machines and tried all the seetinfs for classpath and path mentioned on this message board and it didnt work. However when I reinstalled the Oracle8i client nad tried connecting to the remote database, it Worked !!!
Now I'm having the same problem while configuring other machine and its frustrating as I still dont know why it cant locate the dll file..I dont want to keep reinstalling the client everytime this happens grrrrrrr !
so who knows whats happening here !!! anyone ??

------------------
surent@qsipayments.com
 
Frank Wu
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the LD_LIBRARY_PATH to include the $oracle_home\lib will do
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Frank Wu:
set the LD_LIBRARY_PATH to include the $oracle_home\lib will do

What is the LD_LIBRARY_PATH? How do I set it?
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
SET PATH = %PATH%;C:\orant\oci8\bin
I think that is what is missing from your path
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic