Use when you need programmatic JDBC in Micronaut — pooled DataSource, parameterized SQL, io.micronaut.transaction.annotation.Transactional, batching, and domain exception translation. This should trigger for requests such as Review JDBC or SQL data access in a Micronaut project; Improve transactions and parameter binding for Micronaut JDBC; Translate SQLException to domain exceptions or stream large result sets; Fix self-invocation bypassing @Transactional in Micronaut; Review Hikari or pooled d
SkillScore91Maintained
Automatic
◆Coding pack
Last verified 8/20/2026
What it changes
Passed 18 of 20 test cases with the skill, and 16 of 20 without it.
Without skill82%
With skill91%
Checks it passed that the model alone missed
Extracts row mapping logic into a dedicated mapRow helper method.
Defines an interface extending CrudRepository annotated with @JdbcRepository.
2 fixed18 passed either way2 still failing0 broke
Pass-rate lift
+9 pp
Tokens
-3%
Agent turns
0%
Response time
-37%
Model gemini-3.6-flashMeasured 8/20/2026v120 of 22 cases passed with skill · 20 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
I am writing a JDBC query in Micronaut to fetch user profile details. Should I create a mutable Java bean with getters/setters and populate it line-by-line inline inside `while(rs.next())`, or is there a cleaner approach for mapping ResultSet rows?
What was checked, without and with the skill
Checked
Without skill
With skill
Maps ResultSet rows into an immutable Java record.
Passed
Passed
Extracts row mapping logic into a dedicated mapRow helper method.
Missed
Passed
case-05 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md60 lines2 files
Micronaut JDBC — programmatic SQL
Apply programmatic JDBC patterns in Micronaut with safe SQL and clear transactions.
What is covered in this Skill?
Injected javax.sql.DataSource (Hikari-backed with micronaut-jdbc-hikari) 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; 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 TransactionDefinition.Propagation (e.g. REQUIRES_NEW for independent commits)
Self-invocation pitfall: call transactional collaborators through injected beans, not this.method()
SQL text blocks for multi-line SQL (upserts, dialect-specific clauses)
When to prefer Micronaut Data (@512) 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 improvements
BEFORE APPLYING: Read the reference for detailed rules and examples
When to use this skill
Review JDBC or SQL data access in a Micronaut project
Improve transactions and parameter binding for Micronaut JDBC
Translate SQLException to domain exceptions or stream large result sets
Fix self-invocation bypassing @Transactional in Micronaut
Review Hikari or pooled datasource usage in Micronaut JDBC
Use when you need MongoDB persistence in Micronaut — including @MongoRepository design, document modeling, indexes, query patterns, and error handling. This should trigger for requests such as Add MongoDB in Micronaut; Review Micronaut Data Mongo design; Improve error handling for Micronaut Mongo operations; Model MongoDB documents for a Micronaut service; Configure Micronaut MongoDB codecs indexes or transactions. Part of Plinth Toolkit