Rework database apis

Add a database api around data sources.
Have a separate connection pool api.
Add java interfaces and wrappers for database apis.