Apache Derby offers a number of ways of securing your database, including encryption, user authentication, and authorization. Authentication can be performed with LDAP, a user-defined class library, or Apache Derby's built-in facilities. Users can be authenticated at the system or database level. In addition, access to databases can also be controlled at the read-only or the read-write level.
More details on how to implement LDAP and user-defined authentication can be found in the Apache Derby Developer's Guide at http://incubator.apache.org/derby/manuals/index.html.