title: Elegant way to handle multiple DB operations by single method
body: <p>What is the most elegant way to handle different DB operations by single method? 
  Let's say there's an interface:</p>
  
  <pre><code>public interface ServiceDAO {
      void addRecord(UserRecord userRecord);
      void delRecord(UserRecord userRecord);
      void updateRecord(UserRecord oldRrecord, UserRecord newRecord);
      List&lt;UserRecord&gt; getAllRecords();
  }
  </code></pre>
  
  <p>It's implemented by some class which would also have method for connecting and executing statements on database. 
  At this point I was wondering if there's any nice solution to have one universal method - something like </p>
  
  <pre><code>private Collection&lt;UserRecord&gt; executeStatement(&lt;some args&gt;)
  </code></pre>
  
  <p>which will be able to both process simple SQL selects and do updates? Then all other methods would simply call <code>executeStatement()</code> with appropriate arguments.
  It would've been rather simple task by building SQL string with all parameters as plain text, but that's a bad approach and one should always stick with parametrized PreparedStatements.</p>
  
  <p>I was thinking about creating an object with fields like</p>
  
  <pre><code>class SQLparameters {
      String SQL;
      ArrayList&lt;UserRecord&gt; records;
  }
  </code></pre>
  
  <p>and passing it to <code>executeStatement()</code> but I expect unnecessary complications if logic becomes more sophisticated (i.e. few different possible UPDATE statements or SELECT with many parameters).</p>
  
  <p>Are there any patterns to cover such scenario or should I simply put separate connection handling logic in every method of aforementioned interface?</p>