• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

JDBC Connectivity to Oracle 11g on Windows 7

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

This is Faheem.I am a little new to Java. I have installed Oracle 11g on Windows 7 (64 bit) and am trying to execute a simple JDBC prg. but i get an error saying

package oracle.sql does not exist
package oracle.jdbc.driver does not exist

Oracle 11g is installed in c: Drive.

I have pointed my Path and CLASSPATH as following

CLASSPATH
C:\Program Files (x86)\Java\jdk1.6.0_12\;C:\app\Shaik\product\11.1.0\db_1\oui\jlib\;C:\app\Shaik\product\11.1.0\db_1\owb\wf\lib\;C:\app\Shaik\product\11.1.0\db_1\jdbc\lib\;

Path
C:\app\Shaik\product\11.1.0\db_1\bin;C:\Program Files (x86)\PC Connectivity Solution\;%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\;C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\x64\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter\Driver;C:\Program Files (x86)\Java\jdk1.6.0_12\lib;C:\Program Files (x86)\Java\jdk1.6.0_12\bin;C:\app\Shaik\product\11.1.0\db_1\jdbc\lib\;C:\app\Shaik\product\11.1.0\db_1\BIN;

The following jar files are in the location C:\app\Shaik\product\11.1.0\db_1\jdbc\lib (I have added this location in the Path and CLASSPATH variables)

ojdbc5
ojdbc6
ojdbc5_g
ojdbc6_g
ojdbc6dms_g
orai18n

Any help is truly appreciated.
Thanks in advance.
Shaik Faheem
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the .jars themselves in the classpath, not their directory. And only the jars that you require.
Example:
CLASSPATH=C:\app\Shaik\product\11.1.0\db_1\jdbc\lib\ojdbc5.jar;c:\....
And there is no need at all to add location to the jars to the PATH.
 
Faheem Ahmed Shaik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jan,

Thank you for the reply. pointed classpath to the folder where OJDBC14.jar was present and it is working now.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using eclipse as IDE and trying oracle connectivity with java on windows 7..I did as per your suggestion through older post by pointing classpath where ojdbc14.jar is..still i am getting an exception like "Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver"..please help me out as early as possible..please..thanks in advance...
 
Greenhorn
Posts: 5
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the version of oracle you are trying to connect through ojdbc14.jar
please post the complete exception.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic