With dynamic SQL, database access and authorization are determined at run time. The user of the application must have all required database privileges, and the database must determine the best way to access the required data at run time. However, with static SQL, access and authorization are determined at customization and bind time.
I think Derby is somewhere in between these two. The SQL statements are parsed, compiled, and optimized at runtime, in a dynamic fashion.
However, the database engine automatically maintains a cache of compiled statements, and a re-preparation of a SQL statement simply retrieves the already-compiled statement information from the cache for execution. So Derby achieves the flexibility and adaptability of the dynamic approach, but it also realizes substantial performance benefits by caching the results of the statement bind process and re-using them wherever possible. thanks, bryan
