Class PStmtKey
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.PStmtKey
- Direct Known Subclasses:
PStmtKeyCPDS
A key uniquely identifying
PreparedStatement
s.- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Builder for prepareCall(String sql).private class
Builder for prepareCall(String sql, int resultSetType, int resultSetConcurrency).private class
Builder for prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability).private class
Builder for prepareStatement(String sql).private class
Builder for prepareStatement(String sql, int autoGeneratedKeys).private class
Builder for prepareStatement(String sql, int[] columnIndexes).private class
Builder for prepareStatement(String sql, String[] columnNames).private class
Builder for prepareStatement(String sql, int resultSetType, int resultSetConcurrency).private class
Builder for prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability).private static interface
Interface for Prepared or Callable Statement. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Integer
A flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.private PStmtKey.StatementBuilder
Statement builderprivate final String
Database catalog.private final int[]
An array of column indexes indicating the columns that should be returned from the inserted row or rows.private final String[]
An array of column names indicating the columns that should be returned from the inserted row or rows.private final Integer
Result set concurrency.private final Integer
Result set holdability.private final Integer
Result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.private final String
Database schema.private final String
SQL defining Prepared or Callable Statementprivate final PoolingConnection.StatementType
Statement type, prepared or callable. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.Use @linkPStmtKey(String, String, String, int, int)
.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 Summary
Modifier and TypeMethodDescriptioncreateStatement
(Connection connection) Creates a new Statement from the given Connection.boolean
Gets a flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.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_ONLY
orResultSet.CONCUR_UPDATABLE
.Gets the result set holdability, one of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.CLOSE_CURSORS_AT_COMMIT
.Gets the result set type, one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.The schema.getSql()
Gets the SQL statement.The SQL statement type.int
hashCode()
toString()
-
Field Details
-
sql
SQL defining Prepared or Callable Statement -
resultSetType
Result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
. -
resultSetConcurrency
Result set concurrency. A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
. -
resultSetHoldability
Result set holdability. One of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.CLOSE_CURSORS_AT_COMMIT
. -
catalog
Database catalog. -
schema
Database schema. -
autoGeneratedKeys
A flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
. -
columnIndexes
private final int[] columnIndexesAn array of column indexes indicating the columns that should be returned from the inserted row or rows. -
columnNames
An array of column names indicating the columns that should be returned from the inserted row or rows. -
statementType
Statement type, prepared or callable. -
builder
Statement builder
-
-
Constructor Details
-
PStmtKey
Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.
-
PStmtKey
Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.resultSetType
- A result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.
-
PStmtKey
Deprecated.Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.catalog
- The catalog.
-
PStmtKey
Deprecated.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 ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.
-
PStmtKey
@Deprecated public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency) Deprecated.Use @linkPStmtKey(String, String, String, int, int)
.Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.catalog
- The catalog.resultSetType
- A result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.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 ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
resultSetHoldability
- One of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.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 ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.resultSetHoldability
- One of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.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 ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.statementType
- The SQL statement type, prepared or callable.
-
PStmtKey
Deprecated.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 ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.
-
PStmtKey
Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.catalog
- The catalog.schema
- The schema- Since:
- 2.5.0
-
PStmtKey
Constructs a key to uniquely identify a prepared statement.- Parameters:
sql
- The SQL statement.catalog
- The catalog.schema
- The schemaautoGeneratedKeys
- A flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.- Since:
- 2.5.0
-
PStmtKey
public 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 schemaresultSetType
- A result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.
-
PStmtKey
public 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 schemaresultSetType
- a result set type; one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
resultSetHoldability
- One of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.CLOSE_CURSORS_AT_COMMIT
.- Since:
- 2.5.0
-
PStmtKey
public 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 ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.resultSetHoldability
- One of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.CLOSE_CURSORS_AT_COMMIT
.statementType
- The SQL statement type, prepared or callable.- Since:
- 2.5.0
-
PStmtKey
public 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 ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.resultSetConcurrency
- A concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.statementType
- The SQL statement type, prepared or callable.- Since:
- 2.5.0
-
PStmtKey
Constructs 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.
-
PStmtKey
public 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
-
PStmtKey
public 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 ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.- Since:
- 2.5.0
-
PStmtKey
Constructs 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
-
PStmtKey
Deprecated.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
-
createStatement
Creates 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
-
getAutoGeneratedKeys
Gets a flag indicating whether auto-generated keys should be returned; one ofStatement.RETURN_GENERATED_KEYS
orStatement.NO_GENERATED_KEYS
.- Returns:
- a flag indicating whether auto-generated keys should be returned.
-
getCatalog
The catalog.- Returns:
- The catalog.
-
getColumnIndexes
public 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.
-
getColumnNames
Gets an array of column names indicating the columns that should be returned from the inserted row or rows.- Returns:
- An array of column names.
-
getResultSetConcurrency
Gets the result set concurrency type; one ofResultSet.CONCUR_READ_ONLY
orResultSet.CONCUR_UPDATABLE
.- Returns:
- The result set concurrency type.
-
getResultSetHoldability
Gets the result set holdability, one of the followingResultSet
constants:ResultSet.HOLD_CURSORS_OVER_COMMIT
orResultSet.CLOSE_CURSORS_AT_COMMIT
.- Returns:
- The result set holdability.
-
getResultSetType
Gets the result set type, one ofResultSet.TYPE_FORWARD_ONLY
,ResultSet.TYPE_SCROLL_INSENSITIVE
, orResultSet.TYPE_SCROLL_SENSITIVE
.- Returns:
- the result set type.
-
getSchema
The schema.- Returns:
- The catalog.
-
getSql
Gets the SQL statement.- Returns:
- the SQL statement.
-
getStmtType
The SQL statement type.- Returns:
- The SQL statement type.
-
hashCode
public int hashCode() -
toString
-
PStmtKey(String, String, String)
.