= DataSourceRealm and TomEE DataSource :jbake-date: 2016-09-06 :jbake-type: page :jbake-tomeepdf: :jbake-status: published Example realm-in-tomee can be browsed at https://github.com/apache/tomee/tree/master/examples/realm-in-tomee == Quick start To test it: mvn clean package tomee:run == How does it work? A datasource is defined in tomee.xml: [source,xml] ---- Then this datasource is referenced in server.xml: To initialize the datasource (for the test) we used the TomEE hook which consists in providing a file import-.sql. It should be in the classpath of the datasource so here it is the TomEE classpath so we added it to lib (by default in the classloader). It simply contains the table creations and the insertion of the "admin" "tomee" with the password "tomee". ## Test it Go to http://localhost:8080/realm-in-tomee-1.1.0-SNAPSHOT/, then connect using the login/password tomee/tomee. You should see "Home".