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 * http://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; 020 021import org.apache.commons.dbcp2.PStmtKey; 022 023/** 024 * A key uniquely identifying a {@link PreparedStatement}. 025 * 026 * @since 2.0 027 * @deprecated Use {@link PStmtKey}. 028 */ 029@Deprecated 030public class PStmtKeyCPDS extends PStmtKey { 031 032 /** 033 * Constructs a key to uniquely identify a prepared statement. 034 * 035 * @param sql 036 * The SQL statement. 037 */ 038 public PStmtKeyCPDS(final String sql) { 039 super(sql); 040 } 041 042 /** 043 * Constructs a key to uniquely identify a prepared statement. 044 * 045 * @param sql 046 * The SQL statement. 047 * @param autoGeneratedKeys 048 * A flag indicating whether auto-generated keys should be returned; one of 049 * {@code Statement.RETURN_GENERATED_KEYS} or {@code Statement.NO_GENERATED_KEYS}. 050 */ 051 public PStmtKeyCPDS(final String sql, final int autoGeneratedKeys) { 052 super(sql, null, autoGeneratedKeys); 053 } 054 055 /** 056 * Constructs a key to uniquely identify a prepared statement. 057 * 058 * @param sql 059 * The SQL statement. 060 * @param resultSetType 061 * A result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY}, 062 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}. 063 * @param resultSetConcurrency 064 * A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or 065 * {@code ResultSet.CONCUR_UPDATABLE}. 066 */ 067 public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency) { 068 super(sql, resultSetType, resultSetConcurrency); 069 } 070 071 /** 072 * Constructs a key to uniquely identify a prepared statement. 073 * 074 * @param sql 075 * The SQL statement. 076 * @param resultSetType 077 * a result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY}, 078 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}. 079 * @param resultSetConcurrency 080 * A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or 081 * {@code ResultSet.CONCUR_UPDATABLE} 082 * @param resultSetHoldability 083 * One of the following {@code ResultSet} constants: {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} 084 * or {@code ResultSet.CLOSE_CURSORS_AT_COMMIT}. 085 */ 086 public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency, 087 final int resultSetHoldability) { 088 super(sql, null, resultSetType, resultSetConcurrency, resultSetHoldability); 089 } 090 091 /** 092 * Constructs a key to uniquely identify a prepared statement. 093 * 094 * @param sql 095 * The SQL statement. 096 * @param columnIndexes 097 * An array of column indexes indicating the columns that should be returned from the inserted row or 098 * rows. 099 */ 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}