TAILIEUCHUNG - More Java Pitfalls 50 New Time-Saving Solutions and Workarounds phần 9

Chúng tôi vẫn có thể giải quyết vấn đề, nhưng bây giờ thay vì ngăn chặn nhiều trình, chúng ta cần phải xử lý chúng trở lại vào cuối, thông qua servlet xử lý hình thức. Để hiểu làm thế nào để giải quyết vấn đề trình nhiều, trước tiên chúng ta phải hiểu như thế nào servlet làm việc liên quan đến phiên. | 364 Item 42 Of the approaches we ve discussed so far this seems to have the most merit. In the past it has been difficult to make SQL calls to get autogenerated IDs in a nonproprietary way. It was also a challenge to get the autogenerated key right after the insert ỉimpo PDF Mể ẽwi1àí pnt5jifìrêơistépediVềrồi gpníh w wĩBiWípẽ iỉífĩìẵomìsuit-set. Luckily wMt the ae insertSdrow nanmJumtto geverated key using the gedGenergtedtteya i merhodrnj SQL. sqe i o tatement aseanbe seen in the code segment below tt intprimkey 0. Statements s . execute INSERa ewroveirkOUSKRS name phone address creditcard VALUES MattVanWie 555-9509 91 Habib Ave 20822t902033X9aS Resultset rs 3 3 geOGeneratedKeys if primkey l Many developer ausingantaalier version of the JDK or JDBC or earlier drivers that cannot take advantage of this feature use stored procedures in SQL that can be called from Java widuhe CaUabl taternent interface. The Stored Procedures for Autogenerated Keys EJB Design Pattern from Floyd Marinescu s book EỊB Design Pat-tems provides sucha soOvJisethatdeesan msevt vnd eseurnstVeeutogenereted key ASSESSMENt meeSt tJr eeltmsotfJDKlAana Shva diJyeoget generated keys rrtvsnndddomthei grth. roardesesvand mechanism for soltmveOeEOB pvmarykeypreblem. Other Approaches It is importantto note tìnaOEỊB DesihnPattnns MarinesnUi 2002 discussed in the previous section provides a few design patterns to solve this problem. One worth mentioning is a Universally Unique Identifier UUID pattern for EJB which is a database-independent se rver-sidealgorithm for generating primary keys. Another pattern called Sequence Blddss reeatssprirnary hn ìvithiteìaeisdataUmaìe ím í usinịịa combination of ansmJiJybeontdarvesverana eounier aeG aaeatels ss svesionbeasthdt caches many primary keys from the entity bean at a time. Marinescu Floyd-EnSDemvez Witey .

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.