O'Reilly logo

Java Programming with Oracle JDBC by Donald Bales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 20. Troubleshooting

In this chapter, we’ll finish up by taking a look at common stumbling blocks for JDBC programmers using Oracle. Then we’ll look at the tools available to help determine the source of your grief when your programs don’t work, and conclude with a look at what Oracle has to offer in the near future. Let’s start with the “gotchas,” those pesky details that’ll drive you crazy if you don’t pay attention to detail.

The “Gotchas”

You know them! Those little details that are documented, but for some reason, you ignore them until they pop up their ugly heads and say, “Gotcha!” Until you’ve had your own round with them, you often pay no heed to the letter of the documentation. Even worse, sometimes the documentation is wrong! In the next few sections, we’ll look at the most common stumbling blocks and resource killers. Let’s begin where all new Java programmers suffer, the “Class not found” message.

Class XXX Not Found

“Class XXX not found” is a classic compile-time error message that tells you that one of the class names in your source code is not identifiable. It’s likely that you’ve misspelled a class name and even more likely that you’re missing an import statement. For example, if you remove the import statement for the java.sql package from Example 2-1, you’ll get the following error messages when you compile that program:

TestOCIApp.java:6: Class SQLException not found in throws. throws ClassNotFoundException, SQLException { ^ TestOCIApp.java:11: Class Connection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required