• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Package oracle.sql does not exist

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm attempting to compile a java file - this is a simple compile - no eclipse - I'm using notepad for testing java concepts (accessing Clob data).

That said when attempting to compile my code I'm getting error messages indicating:

C:\JFiles>javac CLOBFileExample.java
CLOBFileExample.java:37: package oracle.sql does not exist
import oracle.sql.*;
^
CLOBFileExample.java:40: package oracle.jdbc does not exist
import oracle.jdbc.*;
^
CLOBFileExample.java:230: cannot resolve symbol
symbol : class CLOB
location: class CLOBFileExample
CLOB xmlClob = null;
^
CLOBFileExample.java:256: cannot resolve symbol
symbol : class OracleResultSet
location: class CLOBFileExample
xmlClob = ((OracleResultSet) rset).getCLOB("xml_Clob_field");
^
CLOBFileExample.java:325: cannot resolve symbol
symbol : class CLOB
location: class CLOBFileExample
CLOB xmlClob = null;
^
CLOBFileExample.java:346: cannot resolve symbol
symbol : variable rseClobt
location: class CLOBFileExample
rseClobt.next();
^
CLOBFileExample.java:347: cannot resolve symbol
symbol : class OracleResultSet
location: class CLOBFileExample
xmlClob = ((OracleResultSet) rset).getCLOB("xml_Clob_field");
^
7 errors

These error messages make me suspect that the classpath is not configured properly. When I review that - there doesn't appear to be any reference to an oracle jar file. I do have an oracle client configured on my workstation.

BTW - "java -version" yields: "java version "1.6.0_20". Furthermore the oracle environment is "10.2.0.3".

Configuring the classpath in not something I'm comfortable with - (like anything else I'll back up before doing anything). Is this the correct route to go? Please advise.

Thank you.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are correct in that classpath is the likely culprit. For compiling though, you do not need to reconfigure anything. Just pass the classpath on the javac command line> javac -cp "pathtofilestoinclude" CLOBFileExample.java

You will need to indentify what jars/libraries to include on the classpath though. I do not recall the filename for the current Oracle drivers libarary, but I use something like ojdbc14.jar
 
bob reilly
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried that and it intially did not work. I reset the classpath back to its original format.

That said - after reading your response - decided my madness was actually moving in the right direction. In my classpath I added at the end "C:\oracle\product\10.2.0\client_2\jdbc\lib\ojdbc14_g.jar" again.

Tested again and it worked. Is this windows? Reboot your workstation any time you make a change like this?

Don't know but I can go forward with my work here - thank you for responding. It is appreciated!!
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

bob reilly wrote:Is this windows? Reboot your workstation any time you make a change like this?



You don't need to be quite that extreme. The command prompt picks up any environment variables that are set when it is opened. If you change any of those variables in the System Properties dialog, any open command prompts will not know about those changes. All you had to do was close the command prompt and open a new one.
 
bob reilly
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good to know - thank you.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic