001/*
002 * Copyright 2002-2018 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 * Represents a returned {@link java.sql.ResultSet} from a stored procedure call.
021 *
022 * <p>A {@link ResultSetExtractor}, {@link RowCallbackHandler} or {@link RowMapper}
023 * must be provided to handle any returned rows.
024 *
025 * <p>Returned {@link java.sql.ResultSet ResultSets} - like all stored procedure
026 * parameters - must have names.
027 *
028 * @author Thomas Risberg
029 * @author Juergen Hoeller
030 */
031public class SqlReturnResultSet extends ResultSetSupportingSqlParameter {
032
033        /**
034         * Create a new instance of the {@link SqlReturnResultSet} class.
035         * @param name name of the parameter, as used in input and output maps
036         * @param extractor ResultSetExtractor to use for parsing the {@link java.sql.ResultSet}
037         */
038        public SqlReturnResultSet(String name, ResultSetExtractor<?> extractor) {
039                super(name, 0, extractor);
040        }
041
042        /**
043         * Create a new instance of the {@link SqlReturnResultSet} class.
044         * @param name name of the parameter, as used in input and output maps
045         * @param handler RowCallbackHandler to use for parsing the {@link java.sql.ResultSet}
046         */
047        public SqlReturnResultSet(String name, RowCallbackHandler handler) {
048                super(name, 0, handler);
049        }
050
051        /**
052         * Create a new instance of the {@link SqlReturnResultSet} class.
053         * @param name name of the parameter, as used in input and output maps
054         * @param mapper RowMapper to use for parsing the {@link java.sql.ResultSet}
055         */
056        public SqlReturnResultSet(String name, RowMapper<?> mapper) {
057                super(name, 0, mapper);
058        }
059
060
061        /**
062         * This implementation always returns {@code true}.
063         */
064        @Override
065        public boolean isResultsParameter() {
066                return true;
067        }
068
069}