How to setup connection string?

In Java we don't support named connection string, however you can pass actual connection string to DocumentStore by calling parseConnectionString on uninitialized store. The RavenDB client will load automatically configuration based on connection string's parameters.

try (DocumentStore store = new DocumentStore()) {
  store.parseConnectionString("Url = http://localhost:8080");


RavenDB connection string format is:

ApiKey string API key to use when accessing the server.
Url string Specify where to locate the server.
Failover string in predefined format Failover server definition. Read more here.
Database or DefaultDatabase string Use a specific database, not the default one. Using this will also ensure that the database exists.


The following are samples of a few RavenDB connection strings:

Url =
    // connect to a remote RavenDB instance at, to the default database
Url =;Database=Northwind
    // connect to a remote RavenDB instance at, to the Northwind database there