Connecting to databases within the system

The standard way to access databases in the file system is by specifying the path name of the database. The path name can be either an absolute path name or a path name relative to the system directory. In a client/server environment, this path name is always on the server machine.

By default, you can connect to databases within the current system directory (see Defining the system directory). To connect to databases within the current system directory, just specify the base name of the database on the connection URL. For example, if your system directory contains a database called myDB, you can connect to that database with the following connection URL:

jdbc:derby:myDB

The full method call within a Java program would be:

Connection conn = DriverManager.getConnection("jdbc:derby:myDB");
Related concepts
Conventions for specifying the database path name
Special database access
Connecting to databases outside the system directory
Related reference
Database connection examples