Accessing databases from the classpath In most cases, you access databases from the file system. However, it is also possible to access databases from the classpath. The databases can be archived into a jar or zip file or left as is. Classpathaccessing databases from

All such databases are read-only.

To access an unarchived database from the classpath, use the classpath subsubprotocol.

For example, for a database called sample in C:\\demo\databases, you can put the C:\\demo\databases directory in the classpath and access sample like this:

jdbc:derby:classpath:sample

If only C:\ were in the classpath, you could access sample (read-only) like this:

jdbc:derby:classpath:demo/databases/sample