I am using tomcat connection pool, jpa, hibernate. The datasource i created in context.xml of tomcat works fine if I try to get it using :
source = (DataSource)
Finally it worked today after i specified the properties below.. because just mentioning the datasource is not enough; we need to specify some properties like which dialect to use. If we specify datasource; we need not specify username , password url of the database ( as all are specified in the datasource configuration itself) .
Most important point is the way you specify the datasource. It should be complete path: java:/comp/env/jdbc/kids . All this while I was missing the slash just before comp.
java:/comp/env/jdbc/kids
com.kids.domain.User