Package org.jboss.forge.addon.database.tools.connections

Examples of org.jboss.forge.addon.database.tools.connections.ConnectionProfile


   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Map<String, ConnectionProfile> connectionProfiles = provider.getConnectionProfileManager()
               .loadConnectionProfiles();
      ConnectionProfile connectionProfile = new ConnectionProfile();
      connectionProfile.setName(name.getValue());
      connectionProfile.setDialect(hibernateDialect.getValue().getClassName());
      connectionProfile.setDriver(driverClass.getValue().getName());
      connectionProfile.setPath(driverLocation.getValue().getFullyQualifiedName());
      connectionProfile.setUrl(jdbcUrl.getValue());
      connectionProfile.setUser(userName.getValue());
      connectionProfile.setPassword(userPassword.getValue());
      connectionProfiles.put(name.getValue(), connectionProfile);
      provider.getConnectionProfileManager().saveConnectionProfiles(connectionProfiles.values());
      return Results.success("Connection profile " + connectionProfile.getName() + " has been saved successfully");
   }
View Full Code Here


         Node node = XMLParser.parse(connectionProfiles);
         for (Node child : node.getChildren())
         {
            if (!child.getName().equals("connection-profile"))
               continue; // Only profile elements are valid
            ConnectionProfile descriptor = new ConnectionProfile();
            descriptor.setName(child.getAttribute(NAME));
            descriptor.setDialect(child.getAttribute(DIALECT));
            descriptor.setDriver(child.getAttribute(DRIVER));
            descriptor.setPath(child.getAttribute(PATH_TO_DRIVER));
            descriptor.setUrl(child.getAttribute(URL));
            descriptor.setUser(child.getAttribute(USER));
            result.put(descriptor.getName(), descriptor);
         }
      }
      return result;
   }
View Full Code Here

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      Map<String, ConnectionProfile> connectionProfiles =
               provider.getConnectionProfileManager().loadConnectionProfiles();
      ConnectionProfile connectionProfile = new ConnectionProfile();
      connectionProfile.setName(name.getValue());
      connectionProfile.setDialect(hibernateDialect.getValue().getClassName());
      connectionProfile.setDriver(driverClass.getValue());
      connectionProfile.setPath(driverLocation.getValue().getFullyQualifiedName());
      connectionProfile.setUrl(jdbcUrl.getValue());
      connectionProfile.setUser(userName.getValue());
      connectionProfiles.put(name.getValue(), connectionProfile);
      provider.getConnectionProfileManager().saveConnectionProfiles(connectionProfiles.values());
      return Results.success(
               "Connection profile " +
                        connectionProfile.getName() +
                        " has been saved successfully");
   }
View Full Code Here

TOP

Related Classes of org.jboss.forge.addon.database.tools.connections.ConnectionProfile

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.