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