问题
I am creating a demo application using Spring mvc 3.0.Now i wants to connect the my application to the data base using "JNDI" and annotations. I am searching on the web,but not find any good example.
Hopefully somebody could give me a good link where I could learn step by step for the annotation driven spring mvc application that communicate with the db layer with the help of annotation and JNDI.
回答1:
what you need is
<jee:jndi-lookup/>
check this link http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/xsd-config.html#xsd-config-body-schemas-jee-jndi-lookup for info on using JNDI lookup . Remaining configurations are similar to app without JNDI .
Check a sample here
来源:https://stackoverflow.com/questions/8487619/creation-of-data-source-and-jndi-communication-in-spring-mvc-application-using