1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.dao;
  17. import org.springframework.core.NestedRuntimeException;
  18. /**
  19. * Root of the hierarchy of data access exceptions discussed in
  20. * <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/">Expert One-On-One J2EE Design and Development</a>.
  21. * Please see Chapter 9 of this book for detailed discussion of the
  22. * motivation for this package.
  23. *
  24. * <p>This exception hierarchy aims to let user code find and handle the
  25. * kind of error encountered without knowing the details of the particular
  26. * data access API in use (e.g. JDBC). Thus it is possible to react to an
  27. * optimistic locking failure without knowing that JDBC is being used.
  28. *
  29. * <p>As this class is a runtime exception, there is no need for user code
  30. * to catch it or subclasses if any error is to be considered fatal
  31. * (the usual case).
  32. *
  33. * @author Rod Johnson
  34. */
  35. public abstract class DataAccessException extends NestedRuntimeException {
  36. /**
  37. * Constructor for DataAccessException.
  38. * @param msg message
  39. */
  40. public DataAccessException(String msg) {
  41. super(msg);
  42. }
  43. /**
  44. * Constructor for DataAccessException.
  45. * @param msg message
  46. * @param ex root cause (usually from using a underlying
  47. * data access API such as JDBC)
  48. */
  49. public DataAccessException(String msg, Throwable ex) {
  50. super(msg, ex);
  51. }
  52. }