Browse Source

Bugfix Kettle Env. #1

userinfo_gueltigkeit
Daniel Quathamer 11 months ago
parent
commit
f8e4e4ba91
  1. 11
      src/de/superx/servlet/SuperXManager.java
  2. 19
      src/de/superx/servlet/SxPool.java

11
src/de/superx/servlet/SuperXManager.java

@ -689,6 +689,11 @@ public class SuperXManager extends HttpServlet { @@ -689,6 +689,11 @@ public class SuperXManager extends HttpServlet {
try {
initKettleEnv();
} catch (Exception e) {
e.printStackTrace();
System.err.println("Kettle konnte nicht initialisiert werden.DETAILS:" + e.getMessage());
}
try {
SxPools.init();
initAll();
@ -704,10 +709,12 @@ public class SuperXManager extends HttpServlet { @@ -704,10 +709,12 @@ public class SuperXManager extends HttpServlet {
}
}
public final static void initKettleEnv() {
public static void initKettleEnv() {
// init kettle environment
try {
KettleEnvironment.init();
KettleLogStore.init();
logger.debug("Kettle environment sucessfully initialized.");
} catch (KettleException e) {
logger.error("Couldn't initialize KettleEnvironment!", e);
}
@ -717,8 +724,6 @@ public class SuperXManager extends HttpServlet { @@ -717,8 +724,6 @@ public class SuperXManager extends HttpServlet {
//DataSourceProviderFactory.setDataSourceProviderInterface(new KettleDataSourceProvider("default",logger));
// init KettleLogStore
KettleLogStore.init();
logger.debug("Kettle environment sucessfully initialized.");
}
private final static class CacheUpdater extends Thread {

19
src/de/superx/servlet/SxPool.java

@ -174,14 +174,19 @@ public class SxPool extends GenericObjectPool implements NamedObjectI { @@ -174,14 +174,19 @@ public class SxPool extends GenericObjectPool implements NamedObjectI {
lastpart = lastpart.replaceAll("\\?ApplicationName.*", "");
String type = getDatabaseAbbr().equals("PG") ? "POSTGRESQL" : "INFORMIX";
// DatabaseMeta.getDatabaseInterfacesMap() ;
kettleDatabaseMeta = new DatabaseMeta("eduetl", type, "Native", host, lastpart, port,
props.getProperty("connectionName"), props.getProperty("password"));
if (lastpart.indexOf(":INFORMIXSERVER") > -1) {
String ixServer = lastpart.substring(lastpart.indexOf(":INFORMIXSERVER") + 16);
String dbname = lastpart.replaceAll(":INFORMIXSERVER=.*", "");
kettleDatabaseMeta.setDBName(dbname);
kettleDatabaseMeta.setServername(ixServer);
try {
kettleDatabaseMeta = new DatabaseMeta("eduetl", type, "Native", host, lastpart, port,
props.getProperty("connectionName"), props.getProperty("password"));
if (lastpart.indexOf(":INFORMIXSERVER") > -1) {
String ixServer = lastpart.substring(lastpart.indexOf(":INFORMIXSERVER") + 16);
String dbname = lastpart.replaceAll(":INFORMIXSERVER=.*", "");
kettleDatabaseMeta.setDBName(dbname);
kettleDatabaseMeta.setServername(ixServer);
}
} catch (Exception e1) {
System.err.println("Fehler bei Kettle DB Einrichtung: "+e1.toString());
e1.printStackTrace();
}
ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
this.props.getProperty("connectionURL"), this.props);

Loading…
Cancel
Save