Jdbc support

This diff is painful...But the tests pass.
We support both. Is the Postgres reference relevant?