If you connect to a read-only database, the appropriate isReadOnly DatabaseMetaData value is returned.
For example, Connections set to read-only using the setReadOnly method, Connections for which the user has been defined as a readOnlyAccess user (with one of the Derby properties), and Connections to databases on read-only media return true.