TAILIEUCHUNG - Professional Portal Development with Open Source Tools Java Portlet API phần 4

Ảnh hưởng đến OJB cách sử dụng chế độ tự động cam kết. Có ba chế độ, chế độ mặc định là 1. 0 - biến tự động cam kết. 1 - thiết lập tự động, cam kết một cách rõ ràng để thực sự khi một kết nối được tạo ra, và tạm thời đặt nó sai khi cần thiết (mặc định). 2 - thiết lập tự động cam kết rõ ràng sai sự thật khi một kết nối được tạo ra. | Chapter 4 Element Description batch-mode Batch-mode is used only if a database supports it. Each implementation of the mode is database-dependent. Batch-mode can be changed at runtime using the .setBatchMode . useAutoCommit Affects the way OJB uses the auto-commit mode. There are three modes the default mode is 1. 0 turns auto-commit off. 1 sets auto-commit explicitly to true when a connection is created and temporarily sets it to false when necessary default . 2 sets auto-commit explicitly to false when a connection is created. ignoreAutoCommit Exceptions If set to false OJB will ignore any exceptions that are thrown from the use of auto-commit. This is the default page that is displayed to users when they access the message board sample Web application. When this page is displayed a list of currently existing messages is shown to the user. This page also provides links to the user to enable the viewing of a specific message in greater detail or to delete a specific message from the database. The code to perform all this functionality is embedded within . In order to retrieve the messages and display them to the user you need to know how many messages exist in the database first. If none are available then there is no need to waste your time trying to iterate through non-existent messages. The following code shows how to use the PersistenceBroker API to retrieve the number of messages that exist in the database PersistenceBroker broker public int getCount try Create a PersistenceBroker object using the PersistenceBrokerFactory. broker Construct a query to be issued Query query new QueryByCriteria null Ask the broker to retrieve the extent collection Collection allMessages query If there are messages then return the number of messages if allMessages null .

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.