JavaStandalone

JDBC UUID Primary Keys

Plain JDBC sample that stores Java UUID primary keys as RAW(16) values in Oracle AI Database.

Testcontainers#Java#Testcontainers#UUID
What this sample helps you learn

This sample shows the smallest useful pattern for storing Java `UUID` primary keys in Oracle AI Database with plain JDBC.

What this sample demonstrates

Testcontainers

Disposable Oracle AI Database Free containers for repeatable local and integration tests.

Use when tests need real database behavior without sharing a long-lived development instance.

Highlights

  • Java UUID values can be stored compactly as RAW(16) primary keys.
  • The conversion is explicit and bit-preserving.
  • JDBC can bind and read the value as bytes without string formatting.
  • A Testcontainers integration test verifies the stored RAW value is exactly 16 bytes and round-trips to the original UUID.