O'Reilly logo

Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ by Dan Scott, George Baklarz, Paul C. Zikopoulos

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

Try/Catch Block

All of the methods within the YMLD application rely on try/catch blocks to trap any errors that might occur when an SQL statement is issued. The catch block is identical in all of the YMLD methods.

try
  Odbc methods...
Catch se As OdbcException
  MsgBox(se.Message)
end try

There is no need to format the error message because the ODBC driver will create the complete message string. The catch block only displays the error message. A programmer might want to capture the error state to determine what should be done with the error. The YMLD application only displays the error message and then continues. A sample error message is shown in Figure 12-6.

Figure 12-6. Sample error message

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