title: Testing Spring service for DB errors with Mockito
body: <p>Following this question- <a href="https://stackoverflow.com/questions/38040567/java-spring-testing-daos-for-dataaccessexception-with-mockito">Java, Spring: Testing DAOs for DataAccessException with Mockito</a>: 
  I'm mocking the JPA repository, and configuring it to throw a DataAccessException on save method. But I'm not sure <strong>how to mock having no DB connection</strong>?<br>
  And also- is DataAccessException will be thrown by the JPA repository for every exception?</p>
  
  <p>Thanks!</p>