implement helper to convert sql type to java type