Use closure in Connection::prepare
Added fetch mode configuration