I have searched through
Java Ranch with no real answers to this question. So I post it here.
I get two errors when trying to connect to my local Oracle 8i Database when compiling my Java program. I am running this database on my laptop, affectionately called "laptop", running Windows 2000 Professional. My database is called "POS" with a username of "system" and a password of "manager".
Here are the two lines of code that give me errors right now...
Class.forName("oracle.jdbc.driver.OracleDriver");
- This one says "Exception java.lang.ClassNotFoundException must be caught, or it must be declared in the throws clause of this constructor"
Connection con;
con = DriverManager.getConnection("jdbc:oracle:thin:@laptop:1521:POS","system","manager");
- This one says "Exception java.sql.SQLException must be caught, or it must be declared in the throws of this constructor"
They both seem to be the same error with the caught and throws and such. Please enlighten me. My program is named POS.java and these commands are in the POS() function.
Anything else you need to know, just post and I will reply ASAP. Thanks!
~Jeff