修复所有数据库性能问题
This commit is contained in:
@@ -33,9 +33,7 @@
|
||||
String url = "jdbc:mysql://localhost:3306/db_school?useUnicode=true&characterEncoding=utf-8";
|
||||
String user = "root";
|
||||
String password = "";
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
Class.forName(driverClass);
|
||||
%>
|
||||
|
||||
|
||||
@@ -48,7 +46,10 @@
|
||||
<div class="col-sm-12 col-lg-9 col-md-9">
|
||||
<%
|
||||
try {
|
||||
Class.forName(driverClass);
|
||||
ResultSet rs = null;
|
||||
Connection conn = null;
|
||||
PreparedStatement sql = null;
|
||||
|
||||
conn = DriverManager.getConnection(url, user, password);
|
||||
Statement stmt = conn.createStatement();
|
||||
sql = conn.prepareStatement("select userName,Email, VIP,Administrator from show_user where userName=?");
|
||||
@@ -121,14 +122,16 @@
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user