Network client security

The Derby Network Client allows you to select a security mechanism by specifying a value for the securityMechanism property.

You can set the securityMechanism property in one of the following ways:

The following table lists the security mechanisms that the Derby Network Client supports, and the corresponding property value to specify to obtain this security mechanism. The default security mechanism is the user id only if no password is set. If the password is set, the default security mechanism is both the user id and password. The default user is APP if no other user is specified.

Table 1. Security mechanisms supported by the Derby Network Client
Security Mechanism securityMechanism Property Value Comments
User id and password ClientDataSource.CLEAR_TEXT_PASSWORD_SECURITY (0x03) Default if password is set
User id only ClientDataSource.USER_ONLY_SECURITY (0x04) Default if password is not set
Encrypted user id and encrypted password ClientDataSource.ENCRYPTED_USER_AND_PASSWORD_SECURITY (0x09) Encryption requires a JCE implementation that supports the Diffie-Hellman algorithm with a public prime of 256 bits.

Derby provides three ClientDataSource implementations. You can use the org.apache.derby.jdbc.ClientDataSource class on Java SE 5 and above (except Java SE 8 Compact Profiles), in applications that call JDBC 3 or JDBC 4.0 methods. You can use the org.apache.derby.jdbc.ClientDataSource40 class on Java SE 6 and above (except Java SE 8 Compact Profiles), in applications that call JDBC 4.1 or JDBC 4.2 methods. You must use the org.apache.derby.jdbc.BasicClientDataSource40 class on Java SE 8 Compact Profile 2 or 3.

Related reference
Network client tracing
Network client driver examples