[[tutorial:configuration]]
= Configuring Neo4j-OGM

Neo4j-OGM supports several drivers:

* Bolt - the lightning fast native driver for Neo4j.
* HTTP - the original transactional HTTP endpoint for remote Neo4j deployments.
* Embedded - for embedded deployments within a Java application.

Our sample application will use the Bolt driver.

[[tutorial:configuration:gradle]]
== Setting up with Gradle

The demo application uses https://gradle.org/[Gradle] as a build system.

Before we can use the library, we need to add a dependency.

.Gradle dependencies for Neo4j-OGM
[source,groovy, subs="attributes"]
----
compile "org.neo4j:neo4j-ogm-core:{ogm-version}"
runtime "org.neo4j:neo4j-ogm-bolt-driver:{ogm-version}"
----

Refer to <<reference:getting-started:dependency-management, Dependency Management>> for more information on dependencies.

[[tutorial:configuration:driver]]
== Connecting to the database

We configure the database parameters by using the configuration builder.

[source, java]
----
Configuration configuration = new Configuration.Builder()
    .uri("bolt://localhost")
    .credentials("neo4j", "password")
    .build();

SessionFactory sessionFactory = new SessionFactory(configuration, "com.mycompany.app.domainclasses");
----


