# Database connection URLs

A JDBC URL provides a way of identifying a database so that the appropriate driver recognizes it and connects to it. In the Derby documentation, a JDBC URL is referred to as a database connection URL.

After the driver is loaded, an application must specify the correct database connection URL to connect to a specific database. The Derby database connection URL allows you to accomplish tasks other than simply connecting.

For complete information about the database connection URL, see the Derby Reference Manual and the Derby Developer's Guide.

A JDBC URL always starts with `jdbc:`. After that, the format for the database connection URL depends on the JDBC driver.

Here is the format for the database connection URL for connecting to an existing Derby database using the embedded driver:

- `jdbc:derby:databaseName;URLAttributes`

The format for the database connection URL for connecting to an existing Derby database using the Network Client is:

- `jdbc:derby://host:port/databaseName;URLAttributes`

The italicized items stand for something the user fills in:

- databaseName

  The name of the database you want to connect to. The databaseName value can be either an absolute path name or a path name relative to derby.system.home, the system directory. The path separator in the connection URL is a forward slash (`/`), even in Windows path names. The database name value cannot contain a colon (`:`), except for the colon after the drive name in a Windows path name.

- URLAttributes

  One or more of the supported attributes of the database connection URL, such as upgrade=true, create=true or territory=ll_CC. For more information, see "Setting attributes for the database connection URL" in the Derby Reference Manual.

- host

  The name of the machine where the server is running. It can be the name of the machine or the address.

- port

  The port number used by the server framework

## About Protocols

Officially, the portion of the database connection URL called the protocol is `jdbc:`, just as `http://` is a protocol in web URLs. After that, `derby:` is officially the subprotocol, and anything else between `jdbc:derby:` and databaseName is called the subsubprotocol. See "Syntax of database connection URLs for applications with embedded databases" in the Derby Reference Manual for details. However, the subprotocol and subsubprotocol are informally considered part of the protocol. When you see references to the protocol in this manual, consider the protocol to be everything that comes before databaseName.

Parent topic: JDBC connection basics