How and Where to add JNDI for Hibernate?

前端 未结 1 1414
故里飘歌
故里飘歌 2021-02-15 17:02

I need the code to add JNDI name to achive connection pooling in hibernate. I have configured the connetion pooling in Jboss server with the JNDI name as \"EmployeeDB\"

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-15 17:19

    The datasource JDNI name configured in the Jboss server is specified by the properties hibernate.connection.datasource.

    The basic hibernate.cfg.xml should look like :

    
    
    
     
        
    
            
            java:comp/env/jdbc/EmployeeDB
    
            
            org.hibernate.dialect.MySQLDialect
    
            
            
    
         
    
    

    0 讨论(0)
提交回复
热议问题