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 ...
Get Java Programming with Oracle JDBC now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.