Multitenancy has become a popular word with cloud. In a multitenancy setup, each tenant will have a separate datasource. We need to create two different data sources and look ups for the datasource. Let's use a simple Wicket application with a customized JSP, which will have a tenant drop down menu. The user selects a tenant from the drop down menu and a datasource corresponding to the tenant will be set.
I am using NetBeans IDE, which will recognize the Maven projects easily. NetBeans also comes with a glassfish application server and derby database.
pom.xmlfile with derby database dependency