| | |
| | | String sql = OutJson.stringReplace(s); |
| | | String[] split = sql.split(";");//以逗号分割 |
| | | for (String sqls : split) { |
| | | if (sqls.length()>1) { |
| | | //判断是否是新增,删除,修改 |
| | | String substring = sqls.substring(0, 2); |
| | | //新增 |
| | | if (substring.equals("in")) { |
| | | //运行sql语句 |
| | | MysqlCenlint.inster(sqls); |
| | | } |
| | | //修改 |
| | | else if (substring.equals("up")) { |
| | | MysqlCenlint.update(sqls); |
| | | } |
| | | //删除 |
| | | else { |
| | | MysqlCenlint.delete(sqls); |
| | | } |
| | | //判断是否是新增,删除,修改 |
| | | String substring = sqls.substring(0, 2); |
| | | //新增 |
| | | if (substring.equals("in")) { |
| | | //运行sql语句 |
| | | MysqlCenlint.inster(sqls); |
| | | } |
| | | //修改 |
| | | else if (substring.equals("up")) { |
| | | MysqlCenlint.update(sqls); |
| | | } |
| | | //删除 |
| | | else { |
| | | MysqlCenlint.delete(sqls); |
| | | } |
| | | } |
| | | //删除本地文件 |
| | |
| | | FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserName, ftpPassword, "anbao/", fileName); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //如果ftp 没有关闭,则关闭ftp |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | ftp.disconnect(); |
| | | } catch (IOException io) { |
| | | io.printStackTrace(); |