411-frameworks-quarkus-jdbc

Solid

Use when you need programmatic JDBC in Quarkus — Agroal DataSource, parameterized SQL, transactions, batching, and Dev Services. Part of the skills-for-java project

AI & Automation 393 stars 78 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 92/100

Stars 20%
86
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Quarkus JDBC — programmatic SQL Apply programmatic JDBC patterns in Quarkus with safe SQL and clear transactions. **What is covered in this Skill?** - Injected javax.sql.DataSource (Agroal-backed) and try-with-resources for Connection / PreparedStatement - PreparedStatement with bind parameters — never string concatenation - Mapping ResultSet rows to Java records (dedicated mapRow method) - Safe single-row queries with Optional<T>; never assume rs.next() succeeds - SQLException translation to domain exceptions (catch-translate-rethrow) - Streaming large result sets with setFetchSize to avoid OOM - Batch updates with addBatch / executeBatch for bulk inserts - @Transactional service boundaries and propagation types (TxType.REQUIRES_NEW for independent commits) - CDI self-invocation pitfall: always call transactional methods through the injected proxy - Dev Services for databases in dev/test - When to prefer Panache (`@412`) vs raw JDBC **Scope:** Apply recommendations based on the reference rules and good/bad code examples. ## Constraints Compile before JDBC refactors; verify after changes. - **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change - **PREREQUISITE**: Project must compile before applying JDBC improvements - **SAFETY**: If compilation fails, stop immediately - **BLOCKING CONDITION**: Compilation errors must be resolved by the user before proceeding - **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improv...

Details

Author
jabrena
Repository
jabrena/cursor-rules-java
Created
1 years ago
Last Updated
today
Language
Java
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

412-frameworks-quarkus-panache

Use when you need data access with Quarkus Hibernate ORM Panache — including PanacheEntity / PanacheEntityBase, PanacheRepository, named queries, JPQL, native SQL, DTO projections (project(Class)), pagination (Page.of()), N+1 avoidance (JOIN FETCH), optimistic locking (@Version / OptimisticLockException), @NamedQuery for validated reusable queries, transactions, @TestTransaction for test isolation, and immutable-friendly patterns. This is the Quarkus analogue to Spring Data for relational persistence. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

511-frameworks-micronaut-jdbc

Use when you need programmatic JDBC in Micronaut — pooled DataSource, parameterized SQL, io.micronaut.transaction.annotation.Transactional, batching, and domain exception translation. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

413-frameworks-quarkus-db-migrations-flyway

Use when you need to add or review Flyway database migrations in a Quarkus application — quarkus-flyway extension, db/migration scripts, quarkus.flyway.* configuration, migrate-at-start, and alignment with JDBC or Panache. Part of the skills-for-java project

393 Updated today
jabrena
AI & Automation Solid

311-frameworks-spring-jdbc

Use when you need to write or review programmatic JDBC with Spring — including JdbcClient (Spring Framework 7+) as the default API, JdbcTemplate only where batch/streaming APIs require JdbcOperations, NamedParameterJdbcTemplate for legacy named-param code, parameterized SQL, RowMapper mapping to records, batch operations, transactions, safe handling of generated keys, DataAccessException handling, read-only transactions, streaming large result sets, and @JdbcTest slice testing. This should trigger for requests such as Review Java code for Spring JDBC (JdbcTemplate, JdbcClient, NamedParameterJdbcTemplate); Apply best practices for Spring JDBC data access in Java code; Detect and fix SQL injection risks in JDBC code; Improve transaction boundaries or exception handling for JDBC operations. Part of cursor-rules-java project

393 Updated today
jabrena
AI & Automation Solid

401-frameworks-quarkus-core

Use when building or reviewing core Quarkus applications with CDI beans and scopes, SmallRye Config and profiles, lifecycle, interceptors and events, virtual threads, and test-friendly design. Part of the skills-for-java project

393 Updated today
jabrena