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.core;
  17. import java.sql.Connection;
  18. import java.sql.SQLException;
  19. import java.util.Map;
  20. /**
  21. * Implement this interface when parameters need to be customized based
  22. * on the connection. We might need to do this to make
  23. * use of proprietary features, available only with a specific
  24. * Connection type.
  25. * @author Rod Johnson
  26. * @author Thomas Risberg
  27. */
  28. public interface ParameterMapper {
  29. /**
  30. * @param con JDBC connection. This is useful (and the purpose
  31. * of this interface) if we need to do something RDBMS-specific
  32. * with a proprietary Connection implementation. This class conceals
  33. * such proprietary details. However, it is best to avoid using
  34. * such proprietary RDBMS features if possible.
  35. * @throws SQLException if a SQLException is encountered setting
  36. * parameter values (that is, there's no need to catch SQLException)
  37. * @return Map of input parameters, keyed by name
  38. */
  39. Map createMap(Connection con) throws SQLException;
  40. }