Optimized getting column types and names

Instead of trying to load the entire table to get the column metadata
of the result set, use jdbc to query for the column metadata directly.

removed some unnecessary imports.