Examples of ReportDataFactoryException


Examples of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException

        stream.close();
      }
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException("The Specified XMI File is invalid: " + xmiFile, e);
    }
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.ReportDataFactoryException

        {
          return connectionProvider.createConnection(realUser, realPassword);
        }
        catch (SQLException e)
        {
          throw new ReportDataFactoryException
              ("JNDI dataconnection was requested, but no connection could be established", e);
        }
      }
    }

    try
    {
      final String connectionInfo = databaseMeta.getURL();
      if (connectionInfo == null)
      {
        throw new ReportDataFactoryException("Unable to create a connection: DatabaseMeta does not contain any driver or connection info");
      }

       final String code = databaseMeta.getPluginId();
      final Map<String, String> map = databaseMeta.getExtraOptions();
      final Iterator<Map.Entry<String, String>> entryIterator = map.entrySet().iterator();

      final DriverConnectionProvider driverProvider = new DriverConnectionProvider();
      driverProvider.setDriver(databaseMeta.getDriverClass());
      driverProvider.setUrl(connectionInfo);
      while (entryIterator.hasNext())
      {
        final Map.Entry<String, String> entry = entryIterator.next();
        final String key = entry.getKey();
        final String realKey = key.substring(code.length() + 1);
        final String value = entry.getValue();
        if (DatabaseMeta.EMPTY_OPTIONS_STRING.equals(value))
        {
          driverProvider.setProperty(realKey, "");
        }
        else
        {
          driverProvider.setProperty(realKey, value);
        }
      }

      return driverProvider.createConnection(realUser, realPassword);
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException("Unable to create a connection", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.