java code compilation scripts and dbHasCompleted implemention.

please review this.