Setting up a datasource with WebSphere Liberty Profile 8.5

前端 未结 3 758
北荒
北荒 2021-01-02 09:02

My web app is getting a data source from JNDI with:

javax.naming.InitialContext ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql         


        
3条回答
  •  既然无缘
    2021-01-02 09:32

    In my case, the solution below works fine for me.

    I created a "Generic project" in Eclipse called "Resources". Inside this project I created a file dataSource.xml with following content:

    
        
            
            
            
        
    
       
            
        
    
        
    
    
    

    And I drag and drop this file for server configuration in Eclipse or create the line in server.xml:

    
    

    The file server.xml was like this:

    
    
        
        
            jsp-2.3
            adminCenter-1.0
            jdbc-4.1
            jndi-1.0
            servlet-3.1
        
    
        
    
                         
    
    
        
    
    
         
    
    
    
      ${server.config.dir}
     
    
        
        
        
    
        
    
    

提交回复
热议问题