• 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

Oracle imports

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently writing my first Java program which is intended to talk to an Oracle database. I have an Oracle db setup, version 8i.
I have looked through online tutorials as to how to make my db query an Oracle db. However, "import oracle.sql.*" and "import oracle.jdbc.driver.*" give me the error "Package oracle.sql not found in import".
Through reading this board, I saw some of you mention that you had to make sure that classes12.zip was in your CLASSPATH. So I placed it there. Still get the same errors.
The database is currently being run locally on the same machine... just to make it easier for me to play with the db and my program at the same time.
I am not quite sure how my code I already have in my program for Oracle will work, logging into the db as well as queries and inserts, but I cannot even try yet until these imports work.
Suggestions would be greatly appreciated. And a little example snippet of code to log into a db in the main would be great as well... just so I can compare it to mine when I figure that mine probably will not work once the imports do.
I am running Visual Cafe 4.0 for a Java Compiler.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the best tutorial / sample actually comes with the Oracle installation. Under $ORACLE_HOME/jdbc is a demos zip/tar (depending upon which platform you're using). Here you'll find a java file JdbcCheckup.java which implements an initial db connection and selects some very simple data.
As for your CLASSPATH, i dont know how Visual Cafe works, but it still sounds like the Oracle classes aren't being appended to your CLASSPATH. Try compiling / running the above from a simple command line, setting your CLASSPATH manually
 
Jeff Grant
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by martin samm:
the best tutorial / sample actually comes with the Oracle installation. Under $ORACLE_HOME/jdbc is a demos zip/tar (depending upon which platform you're using). Here you'll find a java file JdbcCheckup.java which implements an initial db connection and selects some very simple data.
As for your CLASSPATH, i dont know how Visual Cafe works, but it still sounds like the Oracle classes aren't being appended to your CLASSPATH. Try compiling / running the above from a simple command line, setting your CLASSPATH manually


Thanks for the help! I had a hunch it was that CLASSPATH thing. I couldn't get it to let me manually set the CLASSPATH in DOS using the Visual Cafe commands. But, it turned out that I had set the CLASSPATH for the VM to the Classes12.zip instead of the CLASSPATH for the Compiler. Now my quest continues to getting my errors out of my code since it'll try and compiler further.
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic