Interface Credential


public interface Credential
Contract for managing database credentials used by Select AI.

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 Type
    Method
    Description
    boolean
    Creates the database credential represented by this instance.
    boolean
    Drops the database credential represented by this instance.
    boolean
    drop(boolean force)
    Drops the database credential represented by this instance, optionally treating an already absent credential as success.
  • Method Details

    • create

      boolean create() throws SelectAIException
      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:
      true when credential is created successfully
      Throws:
      IllegalArgumentException - when credential configuration is invalid, such as missing credential material, mixed credential modes, or incomplete OCI key material
      SelectAIException - when credential creation fails
    • drop

      boolean drop() throws SelectAIException
      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:
      true when credential is dropped successfully
      Throws:
      SelectAIException - when credential drop fails
    • drop

      boolean drop(boolean force) throws SelectAIException
      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 - when true, return success if the credential does not exist
      Returns:
      true when credential is dropped successfully, or when force is true and the credential is already absent
      Throws:
      SelectAIException - when credential drop fails