# User authorization exceptions

SQL exceptions are returned when errors occur with coarse-grained user authorizations.

Derby validates the database properties when you set the properties. An exception is returned if you specify an invalid value when you set these properties.

If a user attempts to connect to a database but is not authorized to connect to that database, the `SQLException` 04501 is returned.

If a user with read-only access attempts to write to a database, the `SQLException` 08004 (connection refused) is returned.

Parent topic: Configuring coarse-grained user authorization
Related concepts
Setting the default connection access mode
Related reference
Read-only and full access permissions