Java implementation of a Database handler