Changed RecordMapper to use prepared statements

Changed RecordMapper to use prepared statements to improve performance and memory use