Template Method in Connection Template.

Enterprise Java
Connection Strategies in EntityBeans

Prakash Malani
Listing 2. Template Method in Connection Template.

public final Object invokeMethod (String aDataSourceName) {
     Object aReturn = null;
     try {
         Connection c = obtainConnection (aDataSourceName);
         try {
              aReturn = doMethod (c);
         } finally {
              releaseConnection (c);
     } catch (Exception e) {
         throw new EJBException (e.getMessage());
     return aReturn;

About the Author

Prakash Malani is principal engineer at eBuilt Inc., Irvine, CA. Mr. Malani can be contacted at [email protected].


Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events