TAILIEUCHUNG - Beginning Databases with Postgre SQL phần 9

Chúng tôi có thể tạo ra các bộ kết quả thể cập nhật từ báo cáo rằng quy định đồng thời tập hợp kết quả như CONCUR_UPDATEABLE. Chúng tôi có thể sửa đổi các dữ liệu trong bộ kết quả thể cập nhật, cũng như thêm và loại bỏ các hàng. Trong phần này, chúng tôi sẽ xem xét các phương pháp có sẵn để thay đổi trạng thái của kết quả | CHAPTER 17 ACCESSING POSTGRESQL FROM JAVA 505 Table 17-1 lists the mapping of Java types to PostgreSQL data types and JDBC data types. The different JDBC types are defined in the class . Table 17-1. Data Type Cross Reference Java Type JDBC Type PostgreSQL Type tinyint int2 tinyint int2 smallint int2 integer int4 bigint int8 float float 7 double float 8 char char 1 varchar text date date time time timestamp timestamp JAVA_OBJECT oid Working with Updatable Result Sets We can create updatable result sets from statements that specified the result set concurrency as CONCUR_UPDATEABLE. We can modify the data in updatable result sets as well as add and remove rows. In this section we will look at the methods available for modifying the state of result sets. Deleting Data The interface defines the following methods for deleting the current row and verifying the deletion public void deleteRow throws SQLException This method deletes the current row from the result set and from the database. This method cannot be called when the cursor is on INSERT row a special row in a result set for adding data to the underlying database . public boolean rowDeleted throws SQLException The rowDeleted method checks whether the current row has been deleted and returns True if it has been. __ V 506 CHAPTER 17 ACCESSING POSTGRESQL FROM JAVA Updating Data The result set interface defines a set of updateXXX methods for updating the data in the current row of the result set. However these methods don t in themselves update the underlying data in the database the updateRow method must be called to actually change the data in the database. The following lists a few of the more commonly used updateXXX methods for a complete listing see the Java documentation and then the .

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.