title: How to mock a database connection with JUnit?
body: <p>Simply can't find a concrete example where a db connection is mocked. Preferred with Mockito. </p>
  
  <pre><code>public Connection getCon() throws SQLException, Exception {
          Properties login = new Properties();
  
          TimeZone timeZone = TimeZone.getTimeZone("GMT+2:00");
          TimeZone.setDefault(timeZone);
  
          Connection conn = null;
          conn = DriverManager.getConnection(url, username, password);
  
          return conn;
  }
  </code></pre>
  
  <p>Want to test this method...</p>