When user authentication is enabled, an application must provide a user name and password. One way to do this is to use connection URL attributes (see user=userName and password=userPassword).
jdbc:derby:sample;user=jill;password=toFetchAPail
For more information, see Working with user authentication.