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.jdbc.support;
  17. import java.sql.DatabaseMetaData;
  18. import java.sql.SQLException;
  19. /**
  20. * A callback interface used by the JdbcUtils class. Implementations of this
  21. * interface perform the actual work of extracting database meta data, but
  22. * don't need to worry about exception handling. SQLExceptions will be caught
  23. * and handled correctly by the JdbcUtils class.
  24. * @author Thomas Risberg
  25. */
  26. public interface DatabaseMetaDataCallback {
  27. /**
  28. * Implementations must implement this method to process the meta data
  29. * passed in. Exactly what the implementation chooses to do is up to it.
  30. * @param dbmd the DatabaseMetaData to process
  31. * @throws SQLException if a SQLException is encountered getting
  32. * column values (that is, there's no need to catch SQLException)
  33. */
  34. Object processMetaData(DatabaseMetaData dbmd) throws SQLException;
  35. }