# Creating Derby databases for read-only use

You can create Derby databases for use on read-only media such as thumb-drives.

Derby databases in zip or jar files are also read-only databases. Typically, read-only databases are deployed with an application in an embedded environment.

- Creating and preparing the database for read-only use
  To create databases for use on read-only media, perform these steps.
- Deploying the database on the read-only media
  To deploy the database on read-only media, perform the following steps.
- Transferring read-only databases to archive (jar or zip) files
  Once a database has been created in Derby, it can be stored in a jar or zip file and continue to be accessed by Derby in read-only mode.
- Accessing a read-only database in a zip/jar file
  To access a database in a zip/jar, you specify the jar in the subsubprotocol.
- Accessing databases within a jar file using the classpath/modulepath
  Once an archive containing one or more Derby databases has been created it can be placed in the classpath/modulepath. This allows access to a database from within an application without the application's knowing the path of the archive.
- Databases on read-only media and DatabaseMetaData
  Databases on read-only media return true for java.sql.DatabaseMetaData.isReadOnly.

Parent topic: Deploying Derby applications
Related concepts
Loading classes from a database
Embedded systems and properties