我正在尝试将3个不同表中的3个CSV文件压缩到单个zip文件your_files_12354627.zip 。
因此,我拥有以下方法,该方法适用于其中包含1个csv文件的zip文件生成。 我正在尝试对多个文件执行此操作,因此我修改了以下代码(如下工作代码所示):
下面的工作代码:
public void sendMessage(String msg) throws DaoException {
DataSource ds = null;
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement pstmtEmployee = null;
PreparedStatement pstmtCompany = null;
PreparedStatement pstmBuilding = null;
ResultSet rs = null;
ResultSet resultSetFirst = null;
ResultSet resultSetSecond = null;
ResultSet resultSetThird = null;
String[] parts = msg.split("#");
String requestID = parts[0].trim();
String userName = parts[1].trim();
String applicationName = parts[2].trim();
try {
ds = jdbcTemplate.getDataSource();
conn = ds.getConnection();
pstmtEmployee = conn.prepareStatement(getPatientEmployeeSQL);
pstmtEmployee.setString(1, requestID);
resultSetFirst = pstmtEmployee.executeQuery();
pstmtCompany = conn.prepareStatement(getCompanySQL);
pstmtCompany.setString(1, requestID);
resultSetSecond = pstmtCompany.executeQuery();
pstmtBuilding = conn.prepareStatement(getBuildingSQL);
pstmtBuilding.setString(1, requestID);
resultSetThird = pstmtBuilding.executeQuery();
Path dir = Paths