jndi database connection with jpa and eclipselink

前端 未结 5 2040
误落风尘
误落风尘 2021-02-15 11:01

I try to setup a database connection in java with JNDI in combination with eclipseLink/JPA on Tomcat 5.5. I already configured the JNDI resource in web.xml and context.xml.

5条回答
  •  自闭症患者
    2021-02-15 11:42

    Just add the class JPAEclipseLinkSessionCustomizer to your project and configure the persistence.xml as shown below:

    
    
        org.eclipse.persistence.jpa.PersistenceProvider
    
        java:comp/env/jdbc/yourDs        
    
        
                    
        
    
    
    

    You need this workaround only for Apache Tomcat.

提交回复
热议问题