Description: Use the derby.database.defaultConnectionMode property to specify the default type of access that users have when they connect to the database.
Keywords: databases, controlling access to, derby.database.ConnectionMode property, defaultConnectionMode, properties

# Setting the default connection access mode

Use the `derby.database.defaultConnectionMode` property to specify the default type of access that users have when they connect to the database.

The valid settings for the `derby.database.defaultConnectionMode` property are:

- noAccess
- readOnlyAccess
- fullAccess

If you do not specify a setting for the `derby.database.defaultConnectionMode` property, the default access setting is fullAccess.

To set the default connection access mode, specify the access in a CALL statement. For example:

To specify read-write access for the system administrator userID `sa` and the read-only as the default access for anyone else who connects to the database, issue these CALL statements:

    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(
        'derby.database.fullAccessUsers', 'sa')

    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(
        'derby.database.defaultConnectionMode',
        'readOnlyAccess')

To specify read-write access for the user ID Fred and no access for other users, issue these CALL statements:

    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(
        'derby.database.fullAccessUsers', 'Fred')

    CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY(
        'derby.database.defaultConnectionMode',
        'noAccess')

- Setting the user authorizations for individual users
  Use the derby.database.fullAccessUsers and derby.database.readOnlyAccessUsers properties to specify the user IDs that have read-write access and read-only access to a database.

Parent topic: Setting the SQL standard authorization mode
Related concepts
Setting the user authorizations for individual users
SQL standard authorization
Related reference
User authorization exceptions