pai wrote:
Hi all,
I was just thinking why do *bnd files to be binded with the DB2
Database.
Bind files contain the SQL statements extracted from embedded SQL programs.
When binding those files to a database, the SQL statements in them are
validated and compiled into a DB2-internal access plan. Thus, the
compilation is not necessary when invoked again later during runtime of
your applications.
DB2 gets the control over the packages (which are created from bind files).
So DB2 can ensure that no one messes with the statements and, for example,
grant broader access.
Doing away with bind files is only an option if you stick with dynamic SQL
(like JDBC does), or if you would add something specific for each
programming language. But that will be quite complicated and insecure
because DB2 can't ensure that pre-compiled access plans are actually valid.
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany