Migrating DB to Java