Package org.pentaho.reporting.ui.datasources.jdbc.connection

Examples of org.pentaho.reporting.ui.datasources.jdbc.connection.DriverConnectionDefinition


        {
          properties.put(realKey, value);
        }
      }

      return new DriverConnectionDefinition(
          meta.getName(),
          meta.getDriverClass(),
          meta.getURL(),
          meta.getUsername(),
          meta.getPassword(),
View Full Code Here


        final JdbcConnectionDefinition definition = (JdbcConnectionDefinition) model.getElementAt(i);
        if (definition instanceof DriverConnectionDefinition == false)
        {
          continue;
        }
        final DriverConnectionDefinition dcd = (DriverConnectionDefinition) definition;
        if (ObjectUtilities.equal(dcd.getDriverClass(), dcp.getDriver()) &&
            ObjectUtilities.equal(dcd.getUsername(), dcp.getProperty("user")) &&
            ObjectUtilities.equal(dcd.getPassword(), dcp.getProperty("password")) &&
            ObjectUtilities.equal(dcd.getConnectionString(), dcp.getUrl()) &&
            ObjectUtilities.equal(dcd.getName(), dcp.getProperty("::pentaho-reporting::name")))
        {
          return definition;
        }
      }

      String customName = dcp.getProperty("::pentaho-reporting::name");
      if (customName == null)
      {
        customName = getBundleSupport().getString("JdbcConnectionPanel.CustomConnection");
      }

      final String[] strings = dcp.getPropertyNames();
      final Properties p = new Properties();
      for (int i = 0; i < strings.length; i++)
      {
        final String string = strings[i];
        p.put(string, dcp.getProperty(string));
      }

      return new DriverConnectionDefinition
          (customName, dcp.getDriver(), dcp.getUrl(),
              dcp.getProperty("user"), dcp.getProperty("password"),
              dcp.getProperty("::pentaho-reporting::hostname"),
              dcp.getProperty("::pentaho-reporting::database-name"),
              dcp.getProperty("::pentaho-reporting::database-type"),
              dcp.getProperty("::pentaho-reporting::port"),
              p);
    }
    else if (currentJNDISource instanceof JndiConnectionProvider)
    {
      final JndiConnectionProvider jcp = (JndiConnectionProvider) currentJNDISource;
      final ListModel model = dialogModel.getConnections();
      for (int i = 0; i < model.getSize(); i++)
      {
        final JdbcConnectionDefinition definition = (JdbcConnectionDefinition) model.getElementAt(i);
        if (definition instanceof JndiConnectionDefinition == false)
        {
          continue;
        }
        final JndiConnectionDefinition dcd = (JndiConnectionDefinition) definition;

        if (ObjectUtilities.equal(dcd.getJndiName(), jcp.getConnectionPath()))
        {
          return dcd;
        }
      }
      return new JndiConnectionDefinition(getBundleSupport().getString("JdbcConnectionPanel.CustomConnection"),
View Full Code Here

      provider.setPassword(jcd.getPassword());
      connectionProvider = provider;
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

      provider.setPassword(jcd.getPassword());
      newDataFactory = new SimpleSQLReportDataFactory(provider);
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

      provider.setPassword(jcd.getPassword());
      return new SimpleDenormalizedMDXDataFactory(provider);
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

      provider.setPassword(jcd.getPassword());
      returnDataFactory = new BandedMDXDataFactory(provider);
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

      provider.setPassword(jcd.getPassword());
      returnDataFactory = new DenormalizedMDXDataFactory(provider);
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

      provider.setPassword(jcd.getPassword());
      connectionProvider = provider;
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

        final JdbcConnectionDefinition definition = (JdbcConnectionDefinition) model.getElementAt(i);
        if (definition instanceof DriverConnectionDefinition == false)
        {
          continue;
        }
        final DriverConnectionDefinition dcd = (DriverConnectionDefinition) definition;
        if (ObjectUtilities.equal(dcd.getUsername(), dcp.getProperty("JdbcUser")) &&
            ObjectUtilities.equal(dcd.getPassword(), dcp.getProperty("JdbcPassword")) &&
            ObjectUtilities.equal(dcd.getConnectionString(), dcp.getProperty("Jdbc")) &&
            ObjectUtilities.equal(dcd.getDriverClass(), dcp.getProperty("JdbcDrivers")) &&
            ObjectUtilities.equal(dcd.getName(), dcp.getProperty("::pentaho-reporting::name")))
        {
          return definition;
        }
      }

      String customName = dcp.getProperty("::pentaho-reporting::name");
      if (customName == null)
      {
        customName = Messages.getString("Olap4JDataSourceEditor.CustomConnection");
      }

      final String[] strings = dcp.getPropertyNames();
      final Properties p = new Properties();
      for (int i = 0; i < strings.length; i++)
      {
        final String string = strings[i];
        p.put(string, dcp.getProperty(string));
      }

      return new DriverConnectionDefinition
          (customName, dcp.getDriver(), dcp.getUrl(),
              dcp.getProperty("user"), dcp.getProperty("password"),
              dcp.getProperty("::pentaho-reporting::hostname"),
              dcp.getProperty("::pentaho-reporting::database-name"),
              dcp.getProperty("::pentaho-reporting::database-type"),
              dcp.getProperty("::pentaho-reporting::port"),
              p);
    }
    if (currentJNDISource instanceof JndiConnectionProvider)
    {
      final JndiConnectionProvider jcp = (JndiConnectionProvider) currentJNDISource;
      final ListModel model = dialogModel.getConnections();
      for (int i = 0; i < model.getSize(); i++)
      {
        final JdbcConnectionDefinition definition = (JdbcConnectionDefinition) model.getElementAt(i);
        if (definition instanceof JndiConnectionDefinition == false)
        {
          continue;
        }
        final JndiConnectionDefinition dcd = (JndiConnectionDefinition) definition;

        if (ObjectUtilities.equal(dcd.getJndiName(), jcp.getConnectionPath()))
        {
          return dcd;
        }
      }
      return new JndiConnectionDefinition(Messages.getString("Olap4JDataSourceEditor.CustomConnection"),
View Full Code Here

      provider.setPassword(jcd.getPassword());
      return new SimpleDenormalizedMDXDataFactory(provider);
    }
    else if (connectionDefinition instanceof DriverConnectionDefinition)
    {
      final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;
      final DriverConnectionProvider provider = new DriverConnectionProvider();
      provider.setDriver(dcd.getDriverClass());
      provider.setUrl(dcd.getConnectionString());

      final Properties properties = dcd.getProperties();
      final Enumeration keys = properties.keys();
      while (keys.hasMoreElements())
      {
        final String key = (String) keys.nextElement();
        provider.setProperty(key, properties.getProperty(key));
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.ui.datasources.jdbc.connection.DriverConnectionDefinition

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.