TAILIEUCHUNG - Java Data Access—JDBC, JNDI, and JAXP phần 8

Thay đổi các bộ kết quả này sẽ cần phải hiệu lực nhiều bảng, và điều này là không thể trong các phiên bản hiện tại của JDBC. cácTrang này JSP kết nối với cơ sở dữ liệuTôi làm điều này trong các yếu tố chỉ thị JSP. | Chapter 16 Working with JDBC Rowsets Fetching data from a rowset Once you have populated a rowset you need to extract the data from the rowset before it. To do so you rely on an inherited methods where the XXX refers to the Java data type of the variable into which you want to place the value. Just as when using the methods with a ResultSet object you need to consider datatype issues. For example it s possible to lose data precision by using the wrong getXXX method on certain data types. You lose a number s mantissa when trying to retrieve a SQL DOUBLE into a Java int using the getInt method. XRef Chapter 7 Understanding JDBC Data Types provides more information about working with SQL and Java data types. Traversing data in a rowset Because the RowSet interface extends the ResultSet interface you use its methods for moving around a data set. In addition you can also control cursor properties such as scrollability and change sensitivity. A rowset object inherits all these behaviors and properties from the ResultSet interface. For your convenience I present a summary of the cursor-movement methods in Table 16-3. XRef See Chapter 6 Working with Result Sets for more information about moving through the data in a RowSet object using the cursor-movement methods. This chapter also explains how to set transaction-isolation levels and cursor-scrollability characteristics. Table 16-3 RowSet Cursor-Movement Methods Method next previous Description Moves the cursor to the next row. Returns true if successful. Moves the cursor to the previous row. Returns true if successful. beforeFirst Positions the cursor before-the-first row . Calling the getXXX method immediately after this method will produce a SQLException. afterLast Positions the cursor after-the-last row . Calling the getXXX method immediately after this method will produce a SQLException. first Moves the cursor to the first row of the result set. Returns true if successful. last Moves the cursor to the .

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.