文档介绍:Document number【SA80SAB-SAA9SYT-SAATC-SA6UT-SA18】
天津理工大学JEE实验报告
天津理工大学
计算机科学与通信工程学院
实验报告
20
return;
for (int i = 1; i <= ; i++) {
Object param = params[i - 1];
if (param == null) {
(i, ;
} else if (param instanceof Integer) {
(i, (Integer) param);
} else if (param instanceof String) {
(i, (String) param);
} else if (param instanceof Double) {
(i, (Double) param);
} else if (param instanceof Long) {
(i, (Long) param);
} else if (param instanceof Timestamp) {
(i, (Timestamp) param);
} else if (param instanceof Boolean) {
(i, (Boolean) param);
} else if (param instanceof Date) {
(i, (Date) param);
}
}
}
public static int UpdateInfo(Object... params) throws SQLException{
String sql = "update user set password=";
Connection conn = null;
PreparedStatement preStmt = null;
conn = ();
preStmt = (sql);
setParams(preStmt, params);
int num = ();
if (preStmt != null)
();
if (conn != null)
();
return num ;
}
public static void delete(int stuId) throws SQLException{
String sql = "delete from user where username=" ;
Connection conn = null;
PreparedStatement preStmt = null;
conn = ();
preStmt = (sql+stuId);
();
if (preStmt != null)
();
if (conn != null)
();
return ;
}
public stati