001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      https://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.dbcp2.cpdsadapter;
018
019import java.sql.PreparedStatement;
020import java.sql.ResultSet;
021import java.sql.Statement;
022
023import org.apache.commons.dbcp2.PStmtKey;
024
025/**
026 * A key uniquely identifying a {@link PreparedStatement}.
027 *
028 * @since 2.0
029 * @deprecated Use {@link PStmtKey}.
030 */
031@Deprecated
032public class PStmtKeyCPDS extends PStmtKey {
033
034    /**
035     * Constructs a key to uniquely identify a prepared statement.
036     *
037     * @param sql
038     *            The SQL statement.
039     */
040    public PStmtKeyCPDS(final String sql) {
041        super(sql);
042    }
043
044    /**
045     * Constructs a key to uniquely identify a prepared statement.
046     *
047     * @param sql
048     *            The SQL statement.
049     * @param autoGeneratedKeys
050     *            A flag indicating whether auto-generated keys should be returned; one of
051     *            {@link Statement#RETURN_GENERATED_KEYS} or {@link Statement#NO_GENERATED_KEYS}.
052     */
053    public PStmtKeyCPDS(final String sql, final int autoGeneratedKeys) {
054        super(sql, null, autoGeneratedKeys);
055    }
056
057    /**
058     * Constructs a key to uniquely identify a prepared statement.
059     *
060     * @param sql
061     *            The SQL statement.
062     * @param resultSetType
063     *            A result set type; one of {@link ResultSet#TYPE_FORWARD_ONLY},
064     *            {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
065     * @param resultSetConcurrency
066     *            A concurrency type; one of {@link ResultSet#CONCUR_READ_ONLY} or
067     *            {@link ResultSet#CONCUR_UPDATABLE}.
068     */
069    public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency) {
070        super(sql, resultSetType, resultSetConcurrency);
071    }
072
073    /**
074     * Constructs a key to uniquely identify a prepared statement.
075     *
076     * @param sql
077     *            The SQL statement.
078     * @param resultSetType
079     *            a result set type; one of {@link ResultSet#TYPE_FORWARD_ONLY},
080     *            {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
081     * @param resultSetConcurrency
082     *            A concurrency type; one of {@link ResultSet#CONCUR_READ_ONLY} or
083     *            {@link ResultSet#CONCUR_UPDATABLE}
084     * @param resultSetHoldability
085     *            One of the following {@link ResultSet} constants: {@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
086     *            or {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}.
087     */
088    public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency,
089            final int resultSetHoldability) {
090        super(sql, null, resultSetType, resultSetConcurrency, resultSetHoldability);
091    }
092
093    /**
094     * Constructs a key to uniquely identify a prepared statement.
095     *
096     * @param sql
097     *            The SQL statement.
098     * @param columnIndexes
099     *            An array of column indexes indicating the columns that should be returned from the inserted row or
100     *            rows.
101     */
102    public PStmtKeyCPDS(final String sql, final int[] columnIndexes) {
103        super(sql, null, columnIndexes);
104    }
105
106    /**
107     * Constructs a key to uniquely identify a prepared statement.
108     *
109     * @param sql
110     *            The SQL statement.
111     * @param columnNames
112     *            An array of column names indicating the columns that should be returned from the inserted row or rows.
113     */
114    public PStmtKeyCPDS(final String sql, final String[] columnNames) {
115        super(sql, null, columnNames);
116    }
117}