Fleshed out formula. Added support for mysql/postgresql jdbc