• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem connecting to an Oracle database

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have got very confused with my settings.
If I use the code :
conn = DriverManager.getConnection("jdbc racle ci8:@"+"CAVDB","SYSTEM","t1929");.
I get an error message:
java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1344)
at java.lang.Runtime.loadLibrary0(Runtime.java:744)
at java.lang.System.loadLibrary(System.java:815)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at roleOne.server.<init>(server.java:36)
at roleOne.server.main(server.java:195)
But I dont have ocijdbc8 instead I have ocijdbc9, which I have set in my path.
C:\PROGRA~1\RATIONAL\RATION~1\NUTCROOT\bin;
C:\PROGRA~1\RATIONAL\RATION~1\NUTCROOT\bin\x11;
C:\PROGRA~1\RATIONAL\RATION~1\NUTCROOT\mksnt;
C:\jdk1.3.1_04\jre\bin;.;C:\WINDOWS\System32;C:\WINDOWS;.;
C:\jdk1.3.1_04\bin;C:\j2sdkee1.3.1\bin;C:\jakarta-ant-1.3\bin;
C:\bea\wlserver6.1\bin\oci816_8;C:\oracle\ora90\bin;
C:\oracle\ora90\Apache\Perl\5.00503\bin\mswin32-x86;
C:\Program Files\Oracle\jre\1.1.8\bin;
C:\oracle\ora90\jdbc\lib\classes111.zip;
C:\oracle\ora90\BIN\ocijdbc9;C:\WINDOWS\system32;
C:\WINDOWS;C:\WINDOWS\system32\WBEM;C:\WINDOWS\COMMAND;
C:\Program Files\Rational\common;C:\Program Files\Rational\ClearQuest;
C:\Program Files\Rational\Rose\TopLink\;C:\Program Files\Rational\Rational Test
So I have chabged the code to :
conn = DriverManager.getConnection("jdbc racle ci9:@"+"CAVDB","SYSTEM","t1929");
This code works but when I get to the next line of code :
try
{
System.out.println("Server() create statement");
Statement stmt = conn.createStatement();
}
catch(Exception e)
{
System.out.println("Server() problem creating statement");
e.printStackTrace();
System.exit(1);
}
I get the error message:
Server() problem creating statement
java.lang.NullPointerException
at roleOne.server.<init>(server.java:53)
at roleOne.server.main(server.java:219)
Classpath is set to:
.;C:\jdk1.3.1_04\lib\tools.jar;
C:\j2sdkee1.3.1\lib\j2ee.jar;
C:\bea;C:\bea\wlserver6.1\lib\weblogic.jar;
C:\oracle\ora90\jdbc\lib\classes111.zip;
C:\projects\jakarta-Tomcat-4.0\bin\bootstrap.jar
I am using
Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production
JServer Release 9.0.1.1.1 - Production
and Java is jdk1.3.1_04.
Thanks for any help
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have found the problem, if I add C:\bea\wlserver6.1\lib\weblogic.jar; to my Classpath it will ask for ocijdbc8 to be added to my classpath.
Is there a work around as I do not have ocijdbc8 instead I have ocijdbc9.
Do I need to download WebServer7.
Cheers for any help. TE
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic