title: How to unit test an SQL query?
body: <p>I have a class <code>DBHandler</code> which takes a query, runs it through the SQL server, checks for errors and returns the result. How can I unit test this class?</p>
  
  <p><strong>Edit</strong>: I'll try to be more precise:
  <code>DBHandler</code> is in charge of passing the query to the server. In order to test that it actually does that, throws the correct exceptions, etc., I want to connect it to a mock DB which I will populate. My question is - how to do that? How can I create a mock "server" that handles calls? </p>