Class StatementKeyFactory
java.lang.Object
org.apache.derby.client.am.stmtcache.StatementKeyFactory
A factory for creating JDBC statement keys for use with the JDBC statement
cache.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StatementKey
newCallable
(String sql, String schema, int holdability) Creates a key for a callable statement.static StatementKey
newCallable
(String sql, String schema, int rst, int rsc, int rsh) Creates a key for a callable statement specifying result set type and concurrency.static StatementKey
newPrepared
(String sql, String schema, int holdability) Creates a key for a query with default settings.static StatementKey
newPrepared
(String sql, String schema, int holdability, int autogeneratedKeys) Creates a key for a query specifying whether auto-generated keys shall be returned.static StatementKey
newPrepared
(String sql, String schema, int rst, int rsc, int rsh) Creates a key for a query specifying result set type and concurrency.
-
Field Details
-
CALLABLE
private static final boolean CALLABLE- See Also:
-
PREPARED
private static final boolean PREPARED- See Also:
-
-
Constructor Details
-
StatementKeyFactory
private StatementKeyFactory()Instantiation not allowed.
-
-
Method Details
-
newPrepared
Creates a key for a query with default settings.Defaults are according to the JDBC standard; result set type will be
ResultSet.TYPE_FORWARD_ONLY
, concurrency will beResultSet.CONCUR_READ_ONLY
and the statement will not return auto-generated keys.- Parameters:
sql
- SQL query stringschema
- current compilation schemaholdability
- result set holdability- Returns:
- A statement key.
-
newPrepared
public static StatementKey newPrepared(String sql, String schema, int holdability, int autogeneratedKeys) Creates a key for a query specifying whether auto-generated keys shall be returned.Unspecified settings will be according to the JDBC standard; result set type will be
ResultSet.TYPE_FORWARD_ONLY
, concurrency will beResultSet.CONCUR_READ_ONLY
.- Parameters:
sql
- SQL query stringschema
- current compilation schemaholdability
- result set holdabilityautogeneratedKeys
- tells whether or not to reutrn auto-generated keys- Returns:
- A statement key.
-
newPrepared
Creates a key for a query specifying result set type and concurrency.The returned key is for a statement not returning auto-generated keys.
- Parameters:
sql
- SQL query stringschema
- current compilation schemarst
- result set typersc
- result set concurrency levelrsh
- result set holdability- Returns:
- A statement key.
-
newCallable
Creates a key for a callable statement.Unspecified settings will be according to the JDBC standard; result set type will be
ResultSet.TYPE_FORWARD_ONLY
, concurrency will beResultSet.CONCUR_READ_ONLY
.- Parameters:
sql
- SQL query stringschema
- current compilation schemaholdability
- result set holdability- Returns:
- A statement key.
-
newCallable
Creates a key for a callable statement specifying result set type and concurrency.The returned key is for a statement not returning auto-generated keys.
- Parameters:
sql
- SQL query stringschema
- current compilation schemarst
- result set typersc
- result set concurrency levelrsh
- result set holdability- Returns:
- A statement key.
-