PStmtKeyCPDS.java

  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. import java.sql.PreparedStatement;

  19. import org.apache.commons.dbcp2.PStmtKey;

  20. /**
  21.  * A key uniquely identifying a {@link PreparedStatement}.
  22.  *
  23.  * @since 2.0
  24.  * @deprecated Use {@link PStmtKey}.
  25.  */
  26. @Deprecated
  27. public class PStmtKeyCPDS extends PStmtKey {

  28.     /**
  29.      * Constructs a key to uniquely identify a prepared statement.
  30.      *
  31.      * @param sql
  32.      *            The SQL statement.
  33.      */
  34.     public PStmtKeyCPDS(final String sql) {
  35.         super(sql);
  36.     }

  37.     /**
  38.      * Constructs a key to uniquely identify a prepared statement.
  39.      *
  40.      * @param sql
  41.      *            The SQL statement.
  42.      * @param autoGeneratedKeys
  43.      *            A flag indicating whether auto-generated keys should be returned; one of
  44.      *            {@code Statement.RETURN_GENERATED_KEYS} or {@code Statement.NO_GENERATED_KEYS}.
  45.      */
  46.     public PStmtKeyCPDS(final String sql, final int autoGeneratedKeys) {
  47.         super(sql, null, autoGeneratedKeys);
  48.     }

  49.     /**
  50.      * Constructs a key to uniquely identify a prepared statement.
  51.      *
  52.      * @param sql
  53.      *            The SQL statement.
  54.      * @param resultSetType
  55.      *            A result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY},
  56.      *            {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}.
  57.      * @param resultSetConcurrency
  58.      *            A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or
  59.      *            {@code ResultSet.CONCUR_UPDATABLE}.
  60.      */
  61.     public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency) {
  62.         super(sql, resultSetType, resultSetConcurrency);
  63.     }

  64.     /**
  65.      * Constructs a key to uniquely identify a prepared statement.
  66.      *
  67.      * @param sql
  68.      *            The SQL statement.
  69.      * @param resultSetType
  70.      *            a result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY},
  71.      *            {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code ResultSet.TYPE_SCROLL_SENSITIVE}.
  72.      * @param resultSetConcurrency
  73.      *            A concurrency type; one of {@code ResultSet.CONCUR_READ_ONLY} or
  74.      *            {@code ResultSet.CONCUR_UPDATABLE}
  75.      * @param resultSetHoldability
  76.      *            One of the following {@code ResultSet} constants: {@code ResultSet.HOLD_CURSORS_OVER_COMMIT}
  77.      *            or {@code ResultSet.CLOSE_CURSORS_AT_COMMIT}.
  78.      */
  79.     public PStmtKeyCPDS(final String sql, final int resultSetType, final int resultSetConcurrency,
  80.             final int resultSetHoldability) {
  81.         super(sql, null, resultSetType, resultSetConcurrency, resultSetHoldability);
  82.     }

  83.     /**
  84.      * Constructs a key to uniquely identify a prepared statement.
  85.      *
  86.      * @param sql
  87.      *            The SQL statement.
  88.      * @param columnIndexes
  89.      *            An array of column indexes indicating the columns that should be returned from the inserted row or
  90.      *            rows.
  91.      */
  92.     public PStmtKeyCPDS(final String sql, final int[] columnIndexes) {
  93.         super(sql, null, columnIndexes);
  94.     }

  95.     /**
  96.      * Constructs a key to uniquely identify a prepared statement.
  97.      *
  98.      * @param sql
  99.      *            The SQL statement.
  100.      * @param columnNames
  101.      *            An array of column names indicating the columns that should be returned from the inserted row or rows.
  102.      */
  103.     public PStmtKeyCPDS(final String sql, final String[] columnNames) {
  104.         super(sql, null, columnNames);
  105.     }
  106. }