Add JDBC support to the batch subsystem

Added JDBC support to the batch subsystem.

Also a few minor updates to fix various issues found.