Load and Store Methods in Servicing Instance Strategy.

Enterprise Java
Connection Strategies in EntityBeans

Prakash Malani
Listing 6. Load and Store Methods in Servicing Instance Strategy.


protected void doLoad () {
    try {
        ProductDAO aPD = new ProductDAO (mConnection);
        aPD.setUPC(mUPC);
        aPD.load();
        mDescription = aPD.getDescription();
    } catch (SQLException e) {
        e.printStackTrace();
        throw new EJBException ("In ProductEJB: doLoad:\t" +  
            e.getMessage());
    }
}

protected void doStore () {
    try {
        ProductDAO aPD = new ProductDAO (mConnection);
        aPD.setUPC(mUPC);
        aPD.setDescription(mDescription);
        aPD.store();
    } catch (SQLException e) {
        e.printStackTrace();
        throw new EJBException ("In ProductEJB: doStore:\t" +
            e.getMessage());
    }
}

About the Author

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

Upcoming Training Events

0 AM
Visual Studio Live! San Diego
September 8-12, 2025
Live! 360 Orlando
November 16-21, 2025
Cloud & Containers Live! Orlando
November 16-21, 2025
Data Platform Live! Orlando
November 16-21, 2025
Visual Studio Live! Orlando
November 16-21, 2025