Spring Boot examples for connecting to CockroachDB
A collection of examples demonstrating how to connect to CockroachDB using the Spring Framework. Covers DataSource, JDBCTemplate, JPA/Hibernate, and Reactive (R2DBC) access patterns with production-ready retry logic.
Includes Docker Compose examples for local clusters, support for secure and insecure connections, CockroachCloud Serverless integration, and unit and integration test suites.
Tech: Java, Spring Boot, JPA, R2DBC, CockroachDB, Docker
Features
- DataSource, JDBCTemplate, JPA, and Reactive examples
- Spring Retry integration for transaction retries
- Secure and insecure connection profiles
- CockroachCloud Serverless support
- Unit and integration test suites
Links: GitHub: timveil-cockroach/spring-examples
More from the portfolio
This project is part of tvsguide.io, the personal portfolio of Tim Veil — software engineer and CIO at Two Bear Capital, previously at StarTree, Cockroach Labs, and Hortonworks. The full collection covers distributed systems, data infrastructure, JDBC drivers, AI services, build pipelines, real-time analytics, and a couple of personal apps. Each project ships with source code, tech notes, and links to live deployments where applicable.
Browse the project index, read about Tim's background, follow the blog, or return to the homepage. Source code lives on GitHub; professional history is on LinkedIn.