修复所有数据库性能问题
This commit is contained in:
@@ -42,10 +42,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();
|
||||
@@ -56,14 +58,16 @@
|
||||
<option value="<%=rs.getString("AdminName")%>"><%=rs.getString("AdminName")%></option>
|
||||
<%
|
||||
}
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
stmt.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
%>
|
||||
<%
|
||||
sql.close();
|
||||
rs.close();
|
||||
conn.close();
|
||||
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user