You really don't want to take this approach. See How can I lock a file.
In reply to Re: File Read by derby in thread File Read by rheaton