修复所有数据库性能问题
This commit is contained in:
@@ -62,11 +62,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 administrator_job");
|
||||
@@ -76,14 +77,16 @@
|
||||
<option value="<%=rs.getString("AdminJob")%>"><%=rs.getString("AdminJob")%></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