View Javadoc
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    *      https://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  import java.sql.ResultSet;
21  import java.sql.Statement;
22  
23  import org.apache.commons.dbcp2.PStmtKey;
24  
25  /**
26   * A key uniquely identifying a {@link PreparedStatement}.
27   *
28   * @since 2.0
29   * @deprecated Use {@link PStmtKey}.
30   */
31  @Deprecated
32  public class PStmtKeyCPDS extends PStmtKey {
33  
34      /**
35       * Constructs a key to uniquely identify a prepared statement.
36       *
37       * @param sql
38       *            The SQL statement.
39       */
40      public PStmtKeyCPDS(final String sql) {
41          super(sql);
42      }
43  
44      /**
45       * Constructs a key to uniquely identify a prepared statement.
46       *
47       * @param sql
48       *            The SQL statement.
49       * @param autoGeneratedKeys
50       *            A flag indicating whether auto-generated keys should be returned; one of
51       *            {@link Statement#RETURN_GENERATED_KEYS} or {@link Statement#NO_GENERATED_KEYS}.
52       */
53      public PStmtKeyCPDS(final String sql, final int autoGeneratedKeys) {
54          super(sql, null, autoGeneratedKeys);
55      }
56  
57      /**
58       * Constructs a key to uniquely identify a prepared statement.
59       *
60       * @param sql
61       *            The SQL statement.
62       * @param resultSetType
63       *            A result set type; one of {@link ResultSet#TYPE_FORWARD_ONLY},
64       *            {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
65       * @param resultSetConcurrency
66       *            A concurrency type; one of {@link ResultSet#CONCUR_READ_ONLY} or
67       *            {@link ResultSet#CONCUR_UPDATABLE}.
68       */
69      public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency) {
70          super(sql, resultSetType, resultSetConcurrency);
71      }
72  
73      /**
74       * Constructs a key to uniquely identify a prepared statement.
75       *
76       * @param sql
77       *            The SQL statement.
78       * @param resultSetType
79       *            a result set type; one of {@link ResultSet#TYPE_FORWARD_ONLY},
80       *            {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
81       * @param resultSetConcurrency
82       *            A concurrency type; one of {@link ResultSet#CONCUR_READ_ONLY} or
83       *            {@link ResultSet#CONCUR_UPDATABLE}
84       * @param resultSetHoldability
85       *            One of the following {@link ResultSet} constants: {@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
86       *            or {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}.
87       */
88      public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency,
89              final int resultSetHoldability) {
90          super(sql, null, resultSetType, resultSetConcurrency, resultSetHoldability);
91      }
92  
93      /**
94       * Constructs a key to uniquely identify a prepared statement.
95       *
96       * @param sql
97       *            The SQL statement.
98       * @param columnIndexes
99       *            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 }