interfaces are key to writing loosely coupled code JDBC Exception system with spring database access exception:
JDBC: Common problems that can cause SqlException exceptions include:
- program cannot connect to database
- The query being executed has a syntax error
- The table/column referenced in the query does not exist
- Executing an INSERT or update value destroys a database constraint
The data access exception system provided by Spring JDBC solves two problems, one is the JDBC exception, because any data access error will trigger SqlException, so it is too general, and the other is that Hibernate's anomaly system is private so it is associated with the persistent framework.
Exceptions for JDBC:
- Batchupdateexception
- DataTruncation
- SQLException
- SQLWarning
Data access exception for spring:
- DataAccessException
- Cannotacquirelockexception
- Wait a minute (too much)
Database of Spring