String sqld = "select id from hnebony_user where username REGEXP '"
+ usernamebefor + "[1-9][0-9]+' and telephone='' LIMIT 0,1 for update";
Connection conn = jdbc.conn;
try {
conn.setAutoCommit(false);
Statement stat = conn.createStatement();
ResultSet re = stat.executeQuery(sqld);
int id = 0;
while(re.next()){
id = re.getInt(1);
System.out.println(id);
}
String sql = "update hnebony_user set telephone='" + phone
+ "',active_time='" + date + "',callingID='" + mac
+ "',address='" + ip + "',IDcard='" + wxbz + "',name='"
+ weizhiId + "',pause_time='" + datelift
+ "',modified_by='" + shebei + "' where id=" + id;
stat.execute(sql);
conn.commit();
re.close();
stat.close();
conn.close();
return 1;
} catch (SQLException e) {
e.printStackTrace();
}