posted 22 years ago
Third post I found today that has the same problem. (One DB2, One mySQL, now one Oracle).
Doesn't look like you are registering the driver. Only loading the class. Try
The above code works if you import oracle.jdbc.driver.*. If you just put classes12.zip or classes2.zip onto the class path, you will need to do Class.forName().newInstance() and cast that to a Driver.
If you don't register the driver, there is no point in creating an instance of the object.
Also, you might want to declare your Connection variable outside of the try block. So if you catch an error, you will be able to close the connection cleanly in the catch block.
[ December 02, 2002: Message edited by: Michael Zalewski ]
[ December 02, 2002: Message edited by: Michael Zalewski ]