Building the Connection URL

Use the connection URL to supply connection information to the data store that you are accessing. The following is the format of the connection URL for the Simba Couchbase JDBC Driver, where [Host] is the DNS or IP address of the Couchbase Server instance:

jdbc:couchbase://[Host]

By default, the connector connects to port 8093, accesses the database named default, and uses the schema stored in the database. If the database does not contain a schema, then the connector generates and caches a temporary schema to use. For information about creating a schema that can be saved in the database or in a JSON file, see Defining a Schema.

You can specify optional settings such as the number of the TCP port to connect to, the database to access, or any of the connection properties supported by the connector. For a list of the properties available in the connector, see Connector Configuration Options.

The following is the format of a connection URL that specifies some optional settings:

jdbc:couchbase://[Host]:[Port]/[Database];[Property1]=[Value];[Property2]=[Value];...

For example, to connect to port 9000 on a Couchbase Server instance installed on the local machine, connect to a database named default2, and use the schema stored in a local file with the path C:\Documents\Couchbase_JDBC_Schema.json, you would use the following connection URL:

jdbc:couchbase://localhost:8093/default2;
LocalSchemaFile=C:\\Documents\\Couchbase_JDBC_Schema.json;

Important:

  • Properties are case-sensitive.
  • Do not duplicate properties in the connection URL.
  • To make sure that the connection URL is compatible with all JDBC applications, it is recommended that you escape the backslashes (\) in your file paths by typing another backslash.