title: How to synchronize different java programs to access a common resource
body: <p>I am trying to synchronize instances of a class that access a common resource(database). This can be done by using notify and wait() but i need to know that if different java programs are using this class for creating instances than how can synchronize them.
  Thank you</p>