Connecting to databases
You connect to a database using a form of the Derby connection
URL as an argument to the DriverManager.getConnection call.
You specify a path to the database within this connection URL.
- Connecting to databases within the system
The standard way to access databases in the file system is by specifying the path to the database, either absolute or relative to the system directory. In a client/server environment, this path is always on the server machine.
- Connecting to databases outside the system directory
You can also connect to databases in other directories (including subdirectories of the system directory) by specifying a relative or absolute path name to identify the database. The way you specify an absolute path is defined by the host operating system.
- Conventions for specifying the database path
When accessing databases from the file system (instead of from memory, the classpath, or a jar file), any path that is not absolute is interpreted as relative to the system directory.
- Special database access
You can also access databases from the classpath or from a jar file (in the classpath or not) as read-only databases.
- Database connection examples
The examples in this section use the syntax of the connection URL for use in an embedded environment.