Replaced dao implementation, fixed prepared statements query