wood burning stoves 2.0*
The moose likes JDBC and the fly likes Oracle imports Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Oracle imports" Watch "Oracle imports" New topic
Author

Oracle imports

Jeff Grant
Ranch Hand

Joined: Dec 19, 2001
Posts: 169
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.
martin samm
Ranch Hand

Joined: Nov 09, 2000
Posts: 31
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


martin samm<BR>m_sam@rroom.net
Jeff Grant
Ranch Hand

Joined: Dec 19, 2001
Posts: 169
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle imports
 
Similar Threads
Oracle 8I Java Stored Procedures returning a result Set
problem with Date comparison
Author question: JDBC in Java Code.
How can i imp to remote oracle database
how to create BLOB and CLOB data