diff --git a/src/de/superx/spring/DatabaseUtils.java b/src/de/superx/spring/DatabaseUtils.java index c6d17c4..113caf1 100644 --- a/src/de/superx/spring/DatabaseUtils.java +++ b/src/de/superx/spring/DatabaseUtils.java @@ -294,11 +294,17 @@ public class DatabaseUtils { conf.setConnectionTimeout(connectionTimeout); // in HISinOne-BI context: Set PostgreSQL variables to be consistent with // HISinOne itself (which also does some settings - see "DbHandler") - if (co.get(DbPropertyName.jdbcDriver.name()).equals(org.postgresql.Driver.class.getCanonicalName()) && - System.getProperty(SuperXManager.SUPER_X_HISINONE_VERSION) != null) { - conf.setConnectionInitSql("SET standard_conforming_strings TO 'off'; SET datestyle TO 'ISO, DMY';"); + if (co.get(DbPropertyName.jdbcDriver.name()).equals(org.postgresql.Driver.class.getCanonicalName())) { + if (System.getProperty(SuperXManager.SUPER_X_HISINONE_VERSION) != null) { + conf.setConnectionInitSql( + "SET standard_conforming_strings TO 'off'; SET datestyle TO 'ISO, DMY';" + ); + } else if ("eduetl".equals(connectionName)) { + conf.setConnectionInitSql( + "SET datestyle TO 'ISO, DMY';" + ); + } } - String minConnectionsStr = co.get("poolsize_min"); String maxConnectionsStr = co.get("poolsize_max"); int defaultPoolSize = "eduetl".equals(connectionName) ? AppConfig.EDUETL_POOL_SIZE : AppConfig.DEFAULT_POOL_SIZE; diff --git a/src/de/superx/util/DbUtils.java b/src/de/superx/util/DbUtils.java index 46dfec2..7ddd8d7 100644 --- a/src/de/superx/util/DbUtils.java +++ b/src/de/superx/util/DbUtils.java @@ -3,6 +3,12 @@ package de.superx.util; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.sql.*; + public final class DbUtils { private DbUtils() { } @@ -15,4 +21,27 @@ public final class DbUtils { return count != null && count.intValue() > 0; } + /** + * Ein resultset in eine Liste aus String-Maps konvertieren + * + * @param ResultSet + * @return List> + */ + public static List> resultSetToStringList(ResultSet rs) throws SQLException { + List> resultList = new ArrayList<>(); + ResultSetMetaData metaData = rs.getMetaData(); + int columnCount = metaData.getColumnCount(); + + while (rs.next()) { + Map row = new HashMap<>(); + for (int i = 1; i <= columnCount; i++) { + String columnName = metaData.getColumnName(i); + String value = rs.getString(i); + row.put(columnName, value); + } + resultList.add(row); + } + + return resultList; + } } diff --git a/superx/WEB-INF/lib/superx6.0.jar b/superx/WEB-INF/lib/superx6.0.jar index b692492..e6b94c0 100644 Binary files a/superx/WEB-INF/lib/superx6.0.jar and b/superx/WEB-INF/lib/superx6.0.jar differ