Package org.eclipse.birt.report.model.api

Examples of org.eclipse.birt.report.model.api.OdaDataSourceHandle


      e.printStackTrace();
    }
  }

  void buildDataSource() throws SemanticException {
    OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource("Data Source", "org.eclipse.birt.report.data.oda.jdbc");
    dsHandle.setProperty("odaDriverClass", "org.eclipse.birt.report.data.oda.sampledb.Driver");
    dsHandle.setProperty("odaURL", "jdbc:classicmodels:sampledb");
    dsHandle.setProperty("odaUser", "ClassicModels");
    dsHandle.setProperty("odaPassword", "");

    designHandle.getDataSources().add(dsHandle);
  }
View Full Code Here


    Platform.shutdown();
  }

  void createDataSources() throws SemanticException {

    OdaDataSourceHandle dsHandle = elementFactory.newOdaDataSource(
        "Data Source", "org.eclipse.birt.report.data.oda.jdbc");
    dsHandle.setProperty("odaDriverClass",
        "org.eclipse.birt.report.data.oda.sampledb.Driver");
    dsHandle.setProperty("odaURL", "jdbc:classicmodels:sampledb");
    dsHandle.setProperty("odaUser", "ClassicModels");

    reportDesignHandle.getDataSources().add(dsHandle);

  }
View Full Code Here

    while (iterator.hasNext())
    {
      Object dataSource = iterator.next();
      if (dataSource instanceof OdaDataSourceHandle)
      {
        OdaDataSourceHandle dataSH = (OdaDataSourceHandle) dataSource;
     
        try
        {       
          ReportDataSource reportDataSource = dataSourceProvider
              .getDataSource(dataSH.getName());
         
          if (reportDataSource != null)
          {   
            log.info("Overriding BIRT DataSource: " + dataSH.getName());
           
            log.debug("Original connection properties for: " + dataSH.getName());
            log.debug("URL:    " + dataSH.getStringProperty("odaURL"));
            log.debug("DRIVER:    " + dataSH.getStringProperty("odaDriverClass"));
            log.debug("USER:   " + dataSH.getStringProperty("odaUser"));             
 
            try
            {
              dataSH.setStringProperty("odaURL", reportDataSource.getUrl());
              dataSH.setStringProperty("odaDriverClass", reportDataSource.getDriverClassName());
              dataSH.setStringProperty("odaUser", reportDataSource.getUsername());
              dataSH.setStringProperty("odaPassword", reportDataSource.getPassword());           
            }
            catch (SemanticException e)
            {
              log.error("SemanticException", e);
            }
           
            log.debug("New connection properties for: " + dataSH.getName());
            log.debug("URL:    " + dataSH.getStringProperty("odaURL"));
            log.debug("DRIVER:    " + dataSH.getStringProperty("odaDriverClass"));
            log.debug("USER:   " + dataSH.getStringProperty("odaUser"));       
          }
          else
          {
            log.info("Unknown data source: " + dataSH.getName());
          }       
        }
        catch (ProviderException pe)
        {
          log.error("ProviderException", pe);
View Full Code Here

TOP

Related Classes of org.eclipse.birt.report.model.api.OdaDataSourceHandle

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.