[server] Use prepared statements to access database.