8.8. Dynamic Query Window

You will have noticed that all query elements are passed as strings. This has one disadvantage; query syntax is checked only at query compilation or execution time. In most cases, query errors will be detected only during the running of the application. However, it does facilitate the writing of applications that execute ad hoc queries, the details of which are not known at compile time.

An example is the Dynamic Query Window, shown in Figure 8.2. This is a relatively simple Swing application. It uses the JDOBootstrap class to initialize JDO, so all of the configuration parameters can go into the jdo.properties file. It then allows the user to enter the various query element strings. Upon pressing the Prepare button, ...

Get Java™ Data Objects 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.