I am using Java CDI with Tomcat 8, with this how to configure database configuration?
            Asked
            
        
        
            Active
            
        
            Viewed 229 times
        
    -3
            
            
        - 
                    My Beans are configured using steps provided as in https://stackoverflow.com/questions/18995951/how-to-install-and-use-cdi-on-tomcat – Mahantesh H Sep 01 '17 at 15:47
1 Answers
0
            
            
        Tomcat 8 is a servlet container and as far as I know, it does not contain any CDI implementation. Are you shipping it with your application?
In order to connect to a relational database, the obvious choice with Java EE is to use JPA, available in Apache TomEE.
Other way is to instantiate Hibernate, myBatis, JOOQ, plain JDBC or anything you would like on your own using CDI producers.
- 
                    Thank you @ThePaul. CDI works with base Tomcat 8 with some configuuration. We need to have this dependency `org.jboss.weld.servlet weld-servlet 2.3.5.Final runtime 
