Refactored Dao implementations

Refactored Dao implementations so that query parameterswill be escaped
appropriately by the JDBC driver.