Skip to content

Commit

Permalink
spring security fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Feb 22, 2022
1 parent 1cbb2e6 commit b4635bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1722,43 +1722,10 @@ public void exportingWithoutHeader(Connection connexion, String table, OutputStr
* @param table
* @param is
* @param csv
* @param header
* @param aDelim
* @throws Exception
*/
public void importing(Connection connexion, String table, InputStream is, boolean csv, String... aDelim)
throws Exception {
ConnectionWrapper conn = initConnection(connexion);
try {
conn.getConnexion().setAutoCommit(false);
CopyManager copyManager = new CopyManager((BaseConnection) conn.getConnexion());
String delimiter = "";
String quote = Character.toString((char) 2);

if (aDelim != null && aDelim.length > 0) {
delimiter = ", DELIMITER '" + aDelim[0] + "', QUOTE '" + quote + "' ";
}

boolean header = true;
if (aDelim != null && aDelim.length > 1) {
header = false;
}

String h = (header ? ", HEADER true " : "");

if (csv) {
copyManager.copyIn("COPY " + table + " FROM STDIN WITH (FORMAT CSV " + h + delimiter + ") ", is);
} else {
copyManager.copyIn("COPY " + table + " FROM STDIN WITH (FORMAT BINARY)", is);
}
conn.getConnexion().commit();
} catch (Exception e) {
conn.getConnexion().rollback();
LoggerHelper.error(LOGGER, e);
} finally {
conn.close();
}
}

public void importing(Connection connexion, String table, Reader aReader, boolean csv, boolean header,
String... aDelim) throws Exception {
ConnectionWrapper conn = initConnection(connexion);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<version>0.0.2-SNAPSHOT</version>
<project.struts2.version>2.5.20</project.struts2.version>
<project.log4j.version>2.17.1</project.log4j.version>
<project.spring.version>5.2.10.RELEASE</project.spring.version>
<project.spring.version>5.3.16</project.spring.version>
<env.arcVersion>${project.version}</env.arcVersion>
<env.arcVersionDate>unspecified</env.arcVersionDate>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit b4635bf

Please sign in to comment.