001/*
002 * Copyright 2002-2020 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.jdbc.core;
018
019/**
020 * Interface to be implemented by objects that can provide SQL strings.
021 *
022 * <p>Typically implemented by PreparedStatementCreators, CallableStatementCreators
023 * and StatementCallbacks that want to expose the SQL they use to create their
024 * statements, to allow for better contextual information in case of exceptions.
025 *
026 * @author Juergen Hoeller
027 * @since 16.03.2004
028 * @see PreparedStatementCreator
029 * @see CallableStatementCreator
030 * @see StatementCallback
031 */
032public interface SqlProvider {
033
034        /**
035         * Return the SQL string for this object, i.e.
036         * typically the SQL used for creating statements.
037         * @return the SQL string, or {@code null} if not available
038         */
039        String getSql();
040
041}