How can I get the underlying JDBC connection which the CMP bean is using?

sukumar kaukuntla

Technically speaking you can't. But you can access a JDBC connection within the same transaction from a CMP bean using the following XML deployment descriptor :



<enterprise-beans>
   <entity>
      <resource-ref>
             <description>Datasource for the myDB database</description>
             <res-ref-name>jdbc/myDB</res-ref-name>
             <res-type>java.sql.Datasource</res-type>
             <res-auth>Container</res-auth>
      </resource-ref>   
         ...
    </entity>
  ....
</enterprise-beans>
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact