To connect to an existing JavaDB database using the embedded driver:
jdbc:derby:<databaseName>;<URLAttributes>
The options in this syntax are:
- Databasename: Specifies the database name to which the embedded driver should connect.
- URLAttributes: Specifies special URL attributes, such as create, upgrade, and territory, to use while connecting with the database.
To connect to an existing JavaDB database using the network client driver:
jdbc:derby://<host>:<port>/<databaseName>;
- host: Specifies the computer name or Internet Protocol address where Java DB is running. If Java DB is running on the same computer as that of the client, you can use localhost or 127.0.0.1 as the value of the host option.
- Port: Specifies the port number used by JavaDB to accept incoming requests.
- databaseName: Represents the name of the database to connect with.