Đang chuẩn bị liên kết để tải về tài liệu:
Java Server Pages: A Code-Intensive Premium Reference- P15

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Java Server Pages: A Code-Intensive Premium Reference- P15:Before you begin reading Pure JSP Java Server Pages, you might want to take a look at its basic structure. This should help you outline your reading plan if you choose not to read the text from cover to cover. This introduction gives you an overview of what each chapter covers. | tr th Title th th Rating th th Price th th Quantity th while rs.next get the title_name which is a String out.println tr n td rs.getString title_name td get the rating out.println td align center rs.getString rating td get the price out.println td align center rs.getString price td get the quantity out.println td align center rs.getString quantity td n tr Close the ResultSet rs.close out.println table center catch lOException ioe out.println ioe.getMessage catch SQLException sqle out.println sqle.getMessage catch ClassNotFoundException cnfe out.println cnfe.getMessage catch Exception e out.println e.getMessage finally try if con null release the connection no matter what pool.releaseConnection con catch Exception e out.println e.getMessage body html - 141 - There are four sections of this JSP that need to be examined in order to understand how the ConnectionPool works. The first section is included in the following code snippet -- Instantiate the ConnectionPool bean with an id of pool -- jsp useBean id pool scope application class com.purejsp.connectionpool.ConnectionPool This section of code tries to find an instance of a ConnectionPool with application scope and an id of pool. If it cannot find an instance of the pool it will create one. This bean uses application scope because the application beans can be accessed by any JSP until the JSP engine is shut down. The next section of code to be studied is contained in the following code snippet The pool is not initialized if pool.getDriver null initialize the pool pool.setDriver sun.jdbc.odbc.JdbcOdbcDriver pool.setURL jdbc odbc Movie Catalog pool.setSize 5 pool.initializePool In this code snippet we are checking to see if the pool has been initialized. If it has not then we set the appropriate properties to initialize the pool. The third section of code to be looked at is Get a connection from the ConnectionPool con pool.getConnection This section gets a normal JDBC Connection object from the pool. At this point .

Đã 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.