How to include properties from external file to hibernate.cfg.xml?

后端 未结 3 1544
渐次进展
渐次进展 2020-12-07 02:52

I need to be able to store database config properties in src|main|java|dbConnection.properties and include it to hibernate.cfg.xml in form of

3条回答
  •  春和景丽
    2020-12-07 03:43

    You state that you use Spring then why not let Spring do all the hard work. Let a property placeholder replace the placeholders you want.

    
    
    
        
           
                
                
                
                
            
        
     
    

    Free advice instead of using the internal hibernate connection stuff (which isn't adviced to be used in production) configure a datasource in spring and wire that to your LocalSessionFactoryBean

提交回复
热议问题