Byron has a detailed post on why and how to setup JDBC Realm Authentication.
It covers the use of JavaDB (embedded or server mode), creation of the JDBC connection pool with the appropriate settings, along with a few tips.
Send feedback and leads to theaquarium@sun.com