neo4j-driver-java-skill

Write Java and Kotlin code using the Neo4j Java Driver v6 API.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/eklyukin/my-ai-config --skill neo4j-driver-java-skill-eklyukin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-driver-java-skill
Source: https://github.com/eklyukin/my-ai-config/tree/main/skills/neo4j-driver-java-skill
Command: npx skills add https://github.com/eklyukin/my-ai-config --skill neo4j-driver-java-skill-eklyukin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct Neo4j client code in Java or Kotlin requires knowing driver lifecycle rules, transaction APIs, result consumption constraints, and error handling semantics that are easy to get wrong, leading to leaked sessions, ResultConsumedException errors, and non-idempotent writes. ## Core Features & Use Cases - Driver Setup & Lifecycle: Maven/Gradle dependency configuration, single-driver pattern, verifyConnectivity, URI scheme selection, and environment-based credentials. - Transaction APIs: Guidance on choosing between executableQuery, executeRead/executeWrite managed transactions, explicit transactions, async CompletableFuture, and reactive RxSession patterns. - Error Handling & Data Mapping: Covers TransientException retry behavior, commit uncertainty, null-safe value extraction, record-to-Java-class mapping, and UNWIND batch writes. - Use Case: You are building a Spring Boot service that reads and writes Person nodes in Neo4j Aura; the Skill provides the correct executeWrite callback pattern, connection pool tuning, and bookmark handling for causal consistency. ## Quick Start Ask the assistant to write a Java service class that connects to Neo4j Aura and creates Person nodes using managed transactions with proper error handling.

Frequently Asked Questions about neo4j-driver-java-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Neo4j from Java using the official driver?▼

Add the org.neo4j.driver:neo4j-java-driver dependency via Maven or Gradle, then create one Driver instance with GraphDatabase.driver(uri, AuthTokens.basic(user, password)) and call verifyConnectivity(). Share that single driver across the application and close it on shutdown.

What is the difference between executableQuery and executeRead/executeWrite in the Neo4j Java driver?▼

executableQuery is the recommended default for most queries and returns eagerly loaded records with automatic retry. executeRead and executeWrite give callback control and streaming for large results, routing reads to replicas and writes to the leader.

Why does ResultConsumedException happen in Neo4j Java transactions?▼

Result is a lazy cursor tied to the open transaction, so returning it from an executeRead or executeWrite callback means it is already closed when the caller reads it. Collect records into a List or Map inside the callback before returning.

Does the Neo4j Java driver support async and reactive programming?▼

Yes, driver.asyncSession() returns CompletionStage-based APIs for CompletableFuture workflows, and driver.rxSession() integrates with Project Reactor or RxJava for backpressure-aware streaming. Sessions must be closed in both success and error paths, for example with exceptionallyCompose or Flux.usingWhen.

When should I not use this Neo4j Java driver guidance?▼

It does not cover Cypher query authoring, which belongs to a Cypher-focused skill, nor driver version migrations or Spring Data Neo4j annotations like @Node and Neo4jRepository. Those topics require their own dedicated skills.