An application designer can use Data Links to maintain a reference to an existing operating system file in a column of a DB2 table. For the application to update or delete to a linked file, it must first unlink the file from the DB2 UDB table before the operation is allowed to proceed. Data Links allows an application designer the option of choosing from a range of file reference integrity options depending upon the requirements of the application. One may choose to enforce referential integrity or not for a file reference. If referential integrity enforcement is chosen, one may choose to either allow the files to be updated while linked, or made read-only while linked.
Special considerations apply depending upon the exact option chosen.
In this case, any user requiring access to a file, must first access the database to obtain a Data Links access control token before attempting to access the linked file. The file can be accessed with or without requiring any database access. On the contrary, Data Links simplifies many of the tasks associated with managing files that are logically integrated with database information. In the same vein, a restore of the database from a backup results in Data Links automatically restoring the corresponding content of the files, thereby guaranteeing consistency. Data Links treats information residing in file systems as though they were logically within the database, leaving existing applications untouched.