TAILIEUCHUNG - Writing Enterprise Applications with Java™ 2 SDK, Enterprise Edition phần 4

Click Finish. WAR tập tin hộp thoại Properties: • Click Next. Chọn phần hộp thoại Type: • Chọn Servlet (nếu nó chưa được chọn) • Kích Next. Hợp phần chung hộp thoại Properties: • Hãy chắc chắn rằng BonusServlet được chọn cho các lớp Servlet. LESSON 1 BEAN PHẦN SIMPLE | SEPTEMBER 27 2000 33 catch Exception NamingException The try statement in the doGet method creates the CalcBean and BonusBean home interfaces. After calling calcBonus to calculate the bonus the method is called to create an entity bean instance and a corresponding row in the underlying database table. After creating the table the method is called to retrieve the same record by its primary key social security number . Next an HTML page is returned to the browser showing the data originally passed in the calculated bonus and the data retrieved from the database table row. The catch statement catches and handles duplicate primary key values social security numbers . The underlying database table cannot have two rows with the same primary key so if you pass in the same social security number the servlet catches and handles the error before trying to create the entity bean. In the event of a duplicate key the servlet returns an HTML page with the original data passed in the calculated bonus and a duplicate key error message. try Calc theCalculation Retrieve Bonus and Social Security Information String strMult MULTIPLIER Calculate bonus Integer integerMult new Integer strMult multiplier socsec SOCSEC Calculate bonus double bonus theCalculation calc multiplier bonus Create row in table theBonus calc socsec record socsec Display data H1 Bonus Calculation H1 P Soc Sec passed in P P Multiplier passed in multiplier P P Bonus Amount calculated P P Soc Sec retrieved P P Bonus Amount retrieved LESSON 2 A SIMPLE ENTITY BEAN 34 SEPTEMBER 27 2000 P BODY HTML Catch duplicate key error catch .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.