Package de.iritgo.aktera.persist

Examples of de.iritgo.aktera.persist.CreateHandler


              Class klass = Class.forName(createHandlerClassName);

              if (klass != null)
              {
                CreateHandler createHandler = (CreateHandler) klass.newInstance();
                createHandler.setConnection(connection);
                createHandler.createTables(req, persistentFactory, connection, log);
              }
              else
              {
                log
                        .error("CreateDatabase: Unable to find create handler for module '"
                                + moduleId + "'");
              }
            }
            catch (ClassNotFoundException x)
            {
              log.error("CreateDatabase: Unable call create handler for module '" + moduleId + "': " + x);
            }
            catch (Exception x)
            {
              res.addOutput("databaseError", x.getMessage());
              res.addOutput("databaseErrorStackTrace", StringTools.stackTraceToString(x).replaceAll("\n",
                      "<br>"));

              return res;
            }
          }
        }
      }
      catch (SQLException x)
      {
        log.error("Unable to create database connection", x);
      }
      finally
      {
        try
        {
          connection.close();
        }
        catch (SQLException x)
        {
        }
      }

      connection = null;

      try
      {
        connection = dataSourceComponent.getConnection();

        for (Configuration moduleConfig : moduleConfigs)
        {
          String moduleId = moduleConfig.getAttribute("id", "unkown");
          String createHandlerClassName = moduleConfig.getChild("create").getAttribute("class", null);

          if (createHandlerClassName != null)
          {
            try
            {
              System.out.println("CreateDatabase: Creating data of module '" + moduleId
                      + "' with handler '" + createHandlerClassName + "'");

              Class klass = Class.forName(createHandlerClassName);

              if (klass != null)
              {
                CreateHandler createHandler = (CreateHandler) klass.newInstance();
                createHandler.setConnection(connection);
                createHandler.createData(persistentFactory, connection, log, req);
              }
              else
              {
                log
                        .error("CreateDatabase: Unable to find create handler for module '"
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.persist.CreateHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.