jsp, servlet, dao implement MVC architecture where generally everyone closes the database connection
为情所困
为情所困 2017-05-16 17:06:07
0
1
557

No need for various frameworks, just a model like JSP+Servlet+Dao

There are two main problems
1. In theory, Dao is responsible for the database, so all operations with the database (including closing connection, statement, resultsset) should be completed within dao. However, sometimes a certain operation in a servlet involves calling multiple daos, which means that the corresponding connection may be opened and closed multiple times, seriously affecting performance. So should we move it to a servlet?

2. When closing, if the connection is closed, the statement and resultsset will be closed automatically, so you don’t have to work hard to close them all.

为情所困
为情所困

reply all(1)
淡淡烟草味

1 Database connection pool
2 No, statement and resultsset need to be released manually

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!