Class JDBCPrepareOptions
java.lang.Object
io.vertx.sqlclient.PrepareOptions
io.vertx.jdbcclient.JDBCPrepareOptions
Options for preparing JDBC statements.
This class extends PrepareOptions and adds JDBC-specific options for controlling auto-generated keys retrieval during statement execution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanDefault value for auto-generated keys retrieval. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with default values.JDBCPrepareOptions(JsonObject json) Creates a new instance from JSON.Creates a new instance by copying another instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic JDBCPrepareOptionscreateFrom(PrepareOptions options) Creates a JDBC-specific instance from generic prepare options.Returns the indexes of auto-generated keys to retrieve.booleanReturns whether auto-generated keys should be retrieved.setAutoGeneratedKeys(boolean autoGeneratedKeys) Sets whether auto-generated keys should be retrieved.setAutoGeneratedKeysIndexes(JsonArray autoGeneratedKeysIndexes) Sets the indexes or column names of auto-generated keys to retrieve.Methods inherited from class PrepareOptions
toJson, toString
-
Field Details
-
DEFAULT_AUTO_GENERATED_KEYS
public static final boolean DEFAULT_AUTO_GENERATED_KEYSDefault value for auto-generated keys retrieval.- See Also:
-
-
Constructor Details
-
JDBCPrepareOptions
public JDBCPrepareOptions()Creates a new instance with default values. -
JDBCPrepareOptions
Creates a new instance by copying another instance.- Parameters:
other- the instance to copy
-
JDBCPrepareOptions
Creates a new instance from JSON.- Parameters:
json- the JSON object
-
-
Method Details
-
createFrom
Creates a JDBC-specific instance from generic prepare options.- Parameters:
options- the generic prepare options- Returns:
- a new JDBCPrepareOptions instance
-
isAutoGeneratedKeys
public boolean isAutoGeneratedKeys()Returns whether auto-generated keys should be retrieved.- Returns:
- true if auto-generated keys should be retrieved, false otherwise
-
setAutoGeneratedKeys
Sets whether auto-generated keys should be retrieved.This is particularly useful for Oracle databases where batch operations do not support DML returning clauses for generated keys.
- Parameters:
autoGeneratedKeys- true to retrieve auto-generated keys, false to disable- Returns:
- a reference to this, so the API can be used fluently
-
getAutoGeneratedKeysIndexes
Returns the indexes of auto-generated keys to retrieve.- Returns:
- the indexes or column names, or null if not set
-
setAutoGeneratedKeysIndexes
Sets the indexes or column names of auto-generated keys to retrieve.The array can contain either integers (column indexes) or strings (column names).
- Parameters:
autoGeneratedKeysIndexes- the indexes or column names- Returns:
- a reference to this, so the API can be used fluently
-