2019独角兽企业重金招聘Python工程师标准>>>
String info = rs.getString("ip_end"); String[] names = info.split("\."); String ip = ""; for (String s : names) { int d = 0; if (!s.equals("000")) { d = Integer.parseInt(s); } if (ip.length() == 0) { ip += String.valueOf(Integer.valueOf(s)); } else { ip += "." + String.valueOf(Integer.valueOf(s)); } } 更新库里字段 String sql = "update ip_location set province = '" + str_region + "', city = '" + str_city + "', county = '" + str_county + "'where ip_end = '" + info + "'";