Package org.apache.tomcat.dbcp.dbcp2
Class PStmtKey
java.lang.Object
org.apache.tomcat.dbcp.dbcp2.PStmtKey
- Direct Known Subclasses:
- PStmtKeyCPDS
A key uniquely identifying 
PreparedStatements.- Since:
- 2.0
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Deprecated.PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, int resultSetHoldability, PoolingConnection.StatementType statementType) PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.Deprecated.Constructs a key to uniquely identify a prepared statement.Constructs a key to uniquely identify a prepared statement.Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, int resultSetHoldability, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, String schema, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, String schema, PoolingConnection.StatementType statementType, Integer autoGeneratedKeys) Constructs a key to uniquely identify a prepared statement.PStmtKey(String sql, String catalog, PoolingConnection.StatementType statementType) Deprecated.PStmtKey(String sql, String catalog, PoolingConnection.StatementType statementType, Integer autoGeneratedKeys) 
- 
Method SummaryModifier and TypeMethodDescriptioncreateStatement(Connection connection) Creates a new Statement from the given Connection.booleanGets a flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYSorStatement.NO_GENERATED_KEYS.Gets the catalog.int[]Gets an array of column indexes indicating the columns that should be returned from the inserted row or rows.String[]Gets an array of column names indicating the columns that should be returned from the inserted row or rows.Gets the result set concurrency type; one ofResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLE.Gets the result set holdability, one of the followingResultSetconstants:ResultSet.HOLD_CURSORS_OVER_COMMITorResultSet.CLOSE_CURSORS_AT_COMMIT.Gets the result set type, one ofResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVE, orResultSet.TYPE_SCROLL_SENSITIVE.Gets the schema.getSql()Gets the SQL statement.Gets the SQL statement type.inthashCode()toString()
- 
Constructor Details- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
 
- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- resultSetType- A result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
 
- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
 
- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- autoGeneratedKeys- A flag indicating whether auto-generated keys should be returned; one of- Statement.RETURN_GENERATED_KEYSor- Statement.NO_GENERATED_KEYS.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency) Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- resultSetType- A result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- resultSetType- a result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE
- resultSetHoldability- One of the following- ResultSetconstants:- ResultSet.HOLD_CURSORS_OVER_COMMITor- ResultSet.CLOSE_CURSORS_AT_COMMIT.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, int resultSetHoldability, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- resultSetType- a result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
- resultSetHoldability- One of the following- ResultSetconstants:- ResultSet.HOLD_CURSORS_OVER_COMMITor- ResultSet.CLOSE_CURSORS_AT_COMMIT.
- statementType- The SQL statement type, prepared or callable.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- resultSetType- A result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
- statementType- The SQL statement type, prepared or callable.
 
- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- columnIndexes- An array of column indexes indicating the columns that should be returned from the inserted row or rows.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, PoolingConnection.StatementType statementType) Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- statementType- The SQL statement type, prepared or callable.
 
- 
PStmtKey@Deprecated public PStmtKey(String sql, String catalog, PoolingConnection.StatementType statementType, Integer autoGeneratedKeys) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- statementType- The SQL statement type, prepared or callable.
- autoGeneratedKeys- A flag indicating whether auto-generated keys should be returned; one of- Statement.RETURN_GENERATED_KEYSor- Statement.NO_GENERATED_KEYS.
 
- 
PStmtKeyConstructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema
- Since:
- 2.5.0
 
- 
PStmtKeyConstructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema
- autoGeneratedKeys- A flag indicating whether auto-generated keys should be returned; one of- Statement.RETURN_GENERATED_KEYSor- Statement.NO_GENERATED_KEYS.
- Since:
- 2.5.0
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema
- resultSetType- A result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema
- resultSetType- a result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE
- resultSetHoldability- One of the following- ResultSetconstants:- ResultSet.HOLD_CURSORS_OVER_COMMITor- ResultSet.CLOSE_CURSORS_AT_COMMIT.
- Since:
- 2.5.0
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, int resultSetHoldability, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- resultSetType- a result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
- resultSetHoldability- One of the following- ResultSetconstants:- ResultSet.HOLD_CURSORS_OVER_COMMITor- ResultSet.CLOSE_CURSORS_AT_COMMIT.
- statementType- The SQL statement type, prepared or callable.
- Since:
- 2.5.0
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, int resultSetType, int resultSetConcurrency, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- resultSetType- A result set type; one of- ResultSet.TYPE_FORWARD_ONLY,- ResultSet.TYPE_SCROLL_INSENSITIVE, or- ResultSet.TYPE_SCROLL_SENSITIVE.
- resultSetConcurrency- A concurrency type; one of- ResultSet.CONCUR_READ_ONLYor- ResultSet.CONCUR_UPDATABLE.
- statementType- The SQL statement type, prepared or callable.
- Since:
- 2.5.0
 
- 
PStmtKeyConstructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- columnIndexes- An array of column indexes indicating the columns that should be returned from the inserted row or rows.
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, PoolingConnection.StatementType statementType) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- statementType- The SQL statement type, prepared or callable.
- Since:
- 2.5.0
 
- 
PStmtKeypublic PStmtKey(String sql, String catalog, String schema, PoolingConnection.StatementType statementType, Integer autoGeneratedKeys) Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- statementType- The SQL statement type, prepared or callable.
- autoGeneratedKeys- A flag indicating whether auto-generated keys should be returned; one of- Statement.RETURN_GENERATED_KEYSor- Statement.NO_GENERATED_KEYS.
- Since:
- 2.5.0
 
- 
PStmtKeyConstructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- schema- The schema.
- columnNames- An array of column names indicating the columns that should be returned from the inserted row or rows.
- Since:
- 2.5.0
 
- 
PStmtKeyDeprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
- sql- The SQL statement.
- catalog- The catalog.
- columnNames- An array of column names indicating the columns that should be returned from the inserted row or rows.
 
 
- 
- 
Method Details- 
createStatementCreates a new Statement from the given Connection.- Parameters:
- connection- The Connection to use to create the statement.
- Returns:
- The statement.
- Throws:
- SQLException- Thrown when there is a problem creating the statement.
 
- 
equals
- 
getAutoGeneratedKeysGets a flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYSorStatement.NO_GENERATED_KEYS.- Returns:
- a flag indicating whether auto-generated keys should be returned.
 
- 
getCatalogGets the catalog.- Returns:
- The catalog.
 
- 
getColumnIndexespublic int[] getColumnIndexes()Gets an array of column indexes indicating the columns that should be returned from the inserted row or rows.- Returns:
- An array of column indexes.
 
- 
getColumnNamesGets an array of column names indicating the columns that should be returned from the inserted row or rows.- Returns:
- An array of column names.
 
- 
getResultSetConcurrencyGets the result set concurrency type; one ofResultSet.CONCUR_READ_ONLYorResultSet.CONCUR_UPDATABLE.- Returns:
- The result set concurrency type.
 
- 
getResultSetHoldabilityGets the result set holdability, one of the followingResultSetconstants:ResultSet.HOLD_CURSORS_OVER_COMMITorResultSet.CLOSE_CURSORS_AT_COMMIT.- Returns:
- The result set holdability.
 
- 
getResultSetTypeGets the result set type, one ofResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVE, orResultSet.TYPE_SCROLL_SENSITIVE.- Returns:
- the result set type.
 
- 
getSchemaGets the schema.- Returns:
- The catalog.
 
- 
getSqlGets the SQL statement.- Returns:
- the SQL statement.
 
- 
getStmtTypeGets the SQL statement type.- Returns:
- The SQL statement type.
 
- 
hashCodepublic int hashCode()
- 
toString
 
- 
PStmtKey(String, String, String).