The moose likes JDBC and Relational Databases and the fly likes JDBC Connectivity to Oracle 11g on Windows 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Connectivity to Oracle 11g on Windows 7" Watch "JDBC Connectivity to Oracle 11g on Windows 7" New topic

JDBC Connectivity to Oracle 11g on Windows 7

Faheem Ahmed Shaik

Joined: Aug 11, 2010
Posts: 2
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

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\;

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)


Any help is truly appreciated.
Thanks in advance.
Shaik Faheem
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Put the .jars themselves in the classpath, not their directory. And only the jars that you require.
And there is no need at all to add location to the jars to the PATH.

OCUP UML fundamental and ITIL foundation
Faheem Ahmed Shaik

Joined: Aug 11, 2010
Posts: 2
Hi Jan,

Thank you for the reply. pointed classpath to the folder where OJDBC14.jar was present and it is working now.
nikita shimpi

Joined: Jul 04, 2011
Posts: 1
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

Joined: Jun 15, 2010
Posts: 5

what is the version of oracle you are trying to connect through ojdbc14.jar
please post the complete exception.
I agree. Here's the link:
subject: JDBC Connectivity to Oracle 11g on Windows 7
jQuery in Action, 3rd edition