java solution for creating db