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

JDBC Connectivity to Oracle 11g on Windows 7

 
Faheem Ahmed Shaik
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
nikita shimpi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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...
 
aman nagi
Greenhorn
Posts: 5
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the version of oracle you are trying to connect through ojdbc14.jar
please post the complete exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic