Java Standalone

Spring Boot Oracle AI Database Client Info

Spring Boot sample that sets MODULE and ACTION client info on Oracle AI Database connections.

#Java#Observability#SpringBoot
What this sample helps you learn

This example application demonstrates how to add client information to Oracle AI Database connections in a Spring Boot application. It sets client identifiers on database connections for better monitoring and tracing. The application includes a simple REST API for managing books, which sets custom client info (MODULE and ACTION) on each connection used in the API operations.

Highlights

  • ClientInfoApplication: The main Spring Boot application class that configures the DataSource with client info using a BeanPostProcessor.
  • ClientInfoDataSource: A wrapper around the DataSource that applies client info properties to connections.
  • BooksController: A REST controller providing CRUD operations for books, using low-level JDBC with custom client info settings (OCSID.MODULE = "Books", OCSID.ACTION = method name).