修复所有数据库性能问题

This commit is contained in:
FJY
2017-11-01 23:02:30 +08:00
parent b4da65a6e3
commit bca76d88a6
31 changed files with 288 additions and 171 deletions

View File

@@ -56,11 +56,12 @@
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
String user = "root";
String password = "";
Class.forName(driverClass);
try {
ResultSet rs = null;
Connection conn = null;
PreparedStatement sql = null;
try {
Class.forName(driverClass);
conn = DriverManager.getConnection(url, user, password);
Statement stmt = conn.createStatement();
sql = conn.prepareStatement("select * from x2_resourse");
@@ -77,14 +78,16 @@
</tr>
<%
}
sql.close();
rs.close();
conn.close();
stmt.close();
} catch (Exception ex) {
ex.printStackTrace();
}
%>
<%
sql.close();
rs.close();
conn.close();
%>
</table>
</div>