1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 package org.apache.commons.dbcp2.cpdsadapter; 18 19 import java.sql.PreparedStatement; 20 21 import org.apache.commons.dbcp2.PStmtKey; 22 23 /** 24 * A key uniquely identifying a {@link PreparedStatement}. 25 * 26 * @since 2.0 27 * @deprecated Use {@link PStmtKey}. 28 */ 29 @Deprecated 30 public class PStmtKeyCPDS extends PStmtKey { 31 32 /** 33 * Constructs a key to uniquely identify a prepared statement. 34 * 35 * @param sql 36 * The SQL statement. 37 */ 38 public PStmtKeyCPDS(final String sql) { 39 super(sql); 40 } 41 42 /** 43 * Constructs a key to uniquely identify a prepared statement. 44 * 45 * @param sql 46 * The SQL statement. 47 * @param autoGeneratedKeys 48 * A flag indicating whether auto-generated keys should be returned; one of 49 * {@code Statement.RETURN_GENERATED_KEYS} or {@code Statement.NO_GENERATED_KEYS}. 50 */ 51 public PStmtKeyCPDS(final String sql, final int autoGeneratedKeys) { 52 super(sql, null, autoGeneratedKeys); 53 } 54 55 /** 56 * Constructs a key to uniquely identify a prepared statement. 57 * 58 * @param sql 59 * The SQL statement. 60 * @param resultSetType 61 * A result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY}, 62 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}. 63 * @param resultSetConcurrency 64 * A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or 65 * {@code ResultSet.CONCUR_UPDATABLE}. 66 */ 67 public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency) { 68 super(sql, resultSetType, resultSetConcurrency); 69 } 70 71 /** 72 * Constructs a key to uniquely identify a prepared statement. 73 * 74 * @param sql 75 * The SQL statement. 76 * @param resultSetType 77 * a result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY}, 78 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}. 79 * @param resultSetConcurrency 80 * A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or 81 * {@code ResultSet.CONCUR_UPDATABLE} 82 * @param resultSetHoldability 83 * One of the following {@code ResultSet} constants: {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} 84 * or {@code ResultSet.CLOSE_CURSORS_AT_COMMIT}. 85 */ 86 public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency, 87 final int resultSetHoldability) { 88 super(sql, null, resultSetType, resultSetConcurrency, resultSetHoldability); 89 } 90 91 /** 92 * Constructs a key to uniquely identify a prepared statement. 93 * 94 * @param sql 95 * The SQL statement. 96 * @param columnIndexes 97 * An array of column indexes indicating the columns that should be returned from the inserted row or 98 * rows. 99 */ 100 public PStmtKeyCPDS(final String sql, final int[] columnIndexes) { 101 super(sql, null, columnIndexes); 102 } 103 104 /** 105 * Constructs a key to uniquely identify a prepared statement. 106 * 107 * @param sql 108 * The SQL statement. 109 * @param columnNames 110 * An array of column names indicating the columns that should be returned from the inserted row or rows. 111 */ 112 public PStmtKeyCPDS(final String sql, final String[] columnNames) { 113 super(sql, null, columnNames); 114 } 115 }