tailieunhanh - Java Server Pages: A Code-Intensive Premium Reference- P15

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 get the title_name which is a String tr n td title_name td get the rating td align center rating td get the price td align center price td get the quantity td align center quantity td n tr Close the ResultSet table center catch lOException ioe catch SQLException sqle catch ClassNotFoundException cnfe catch Exception e finally try if con null release the connection no matter what con catch Exception e 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 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 null initialize the pool jdbc odbc Movie Catalog 5 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 This section gets a normal JDBC Connection object from the pool. At this point .

TỪ KHÓA LIÊN QUAN