Interface Credential
A credential is stored in the database so PL/SQL packages can authenticate to an external service without the Java application sending secrets on every call. Select AI profiles commonly reference credentials for AI provider API access, and vector-index or summarization flows may reference credentials for object storage access.
A Credential object is initialized from credential configuration and
is associated with the configured database credential name. Create and drop
operations require a valid credential name and, for creation, a complete
supported credential configuration. The SDK rejects invalid create
configuration with IllegalArgumentException before JDBC execution.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleancreate()Creates the database credential represented by this instance.booleandrop()Drops the database credential represented by this instance.booleandrop(boolean force) Drops the database credential represented by this instance, optionally treating an already absent credential as success.
-
Method Details
-
create
Creates the database credential represented by this instance.Use this before creating profiles or vector indexes that reference the credential for provider or object-storage access. For a complete runnable sample source, see CreateCredentialSample source.
- Returns:
truewhen credential is created successfully- Throws:
IllegalArgumentException- when credential configuration is invalid, such as missing credential material, mixed credential modes, or incomplete OCI key materialSelectAIException- when credential creation fails
-
drop
Drops the database credential represented by this instance.Dropping a credential can break profiles or indexes that still reference it, so callers should remove or update dependent resources first. For a complete runnable sample source, see DropCredentialSample source.
- Returns:
truewhen credential is dropped successfully- Throws:
SelectAIException- when credential drop fails
-
drop
Drops the database credential represented by this instance, optionally treating an already absent credential as success.For a complete runnable sample source, see DropCredentialSample source.
- Parameters:
force- whentrue, return success if the credential does not exist- Returns:
truewhen credential is dropped successfully, or whenforceistrueand the credential is already absent- Throws:
SelectAIException- when credential drop fails
-