毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 英语论文 >> 正文

JSP和JDBC访问数据库英文文献和翻译 第2页

更新时间:2016-4-21:  来源:毕业论文
finally{} clauses ensure that resource cleanup proceeds.  家长会班主任发言稿
The actual processing of the results is only hinted at here; we'll be looking at it more closely later on in this article. If we were performing a database update instead of a query, we would replace the while loop with the following:
int count = statement.executeUpdate(sqlUpdate);
The executeUpdate() method returns the number of rows affected by the update statement.
If the material in these code listings seems unfamiliar, you may want to spend some time reviewing some of the JDBC tutorial information found in the Resources section.
Using JDBC with JSP pages
So how do we combine JDBC and JSP technologies so that our dynamic content comes from a database?
As a general rule, good JSP practice suggests that you separate presentation from model behavior. This is analogous to the Model-View-Controller (MVC) paradigm in object-oriented programming. One reason for the separation is that applications based on JSP technology are likely to have the Model and Controller components authored by programmers, whereas the View components will be authored by page designers. In the case of JSP application architectures, the role of View, whose responsibility is presentation, is handled by a JSP page. The role of Controller, whose responsibility is reacting to requests, is often played by a servlet, but many JSP practitioners are coming to realize the advantages of using a JSP page in the Controller role. The role of Model, whose responsibility is modeling the behavior of application entities, is typically played by JavaBeans components.
In addition to deciding where in the MVC paradigm to interact with the database, you have several choices for integrating JDBC technology into your JSP pages. For example, you can insert JDBC using scriptlets, insert it using a tag library, or hide it within custom tags or other classes. We'll next look at examples of several approaches and discuss their use.
A tag library example using DBTags
One of the first things that a new JSP programmer hears, usually from

上一页  [1] [2] [3] [4] [5] 下一页

JSP和JDBC访问数据库英文文献和翻译 第2页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。