Examples of DataSourceException


Examples of com.clarkparsia.empire.ds.DataSourceException

            aReader.setProperty("WARN_REDEFINITION_OF_ID","EM_IGNORE");

            aReader.read(theModel, theReader, theBase != null ? theBase : "");
        }
        catch (JenaException e) {
            throw new DataSourceException("There was a Jena error while reading the source", e);
        }
    }
View Full Code Here

Examples of com.gentics.api.lib.datasource.DatasourceException

      String rootId = rW.getParameter(ROOT_ID);
      // Parse the given expression and create a datasource filter
      try {
        ds = this.config.getDatasource();
        if (ds == null) {
          throw (new DatasourceException("No Datasource available."));
        }

        dsFilter = request.getPreparedFilter(config, ds);

        // add base resolvables
View Full Code Here

Examples of com.gentics.api.lib.datasource.DatasourceException

    // Parse the given expression and create a datasource filter
    try {
      ds = this.config.getDatasource();
      if (ds == null) {
        throw (new DatasourceException("No Datasource available."));
      }

      dsFilter = myREQ.getPreparedFilter(config, ds);

      // add base resolvables
View Full Code Here

Examples of com.gentics.api.lib.datasource.DatasourceException

    if (request != null) {
      // Parse the given expression and create a datasource filter
      try {
        ds = this.config.getDatasource();
        if (ds == null) {
          throw (new DatasourceException("No Datasource available."));
        }

        dsFilter = request.getPreparedFilter(config, ds);
        // add base resolvables
        if (this.resolvables != null) {
View Full Code Here

Examples of com.gentics.api.lib.datasource.DatasourceException

      // Parse the given expression and create a datasource filter
      try {
        ds = this.config.getDatasource();
        if (ds == null) {
          throw (new DatasourceException("No Datasource available."));
        }

        dsFilter = request.getPreparedFilter(config, ds);

        // add base resolvables
View Full Code Here

Examples of com.google.visualization.datasource.base.DataSourceException

  public DataTable generateDataTable(Query query, HttpServletRequest request)
      throws DataSourceException {
    String url = request.getParameter(URL_PARAM_NAME);
    if (StringUtils.isEmpty(url)) {
      log.error("url parameter not provided.");
      throw new DataSourceException(ReasonType.INVALID_REQUEST, "url parameter not provided");
    }

    Reader reader;
    try {
      reader = new BufferedReader(new InputStreamReader(new URL(url).openStream()));
    } catch (MalformedURLException e) {
      log.error("url is malformed: " + url);
      throw new DataSourceException(ReasonType.INVALID_REQUEST, "url is malformed: " + url);
    } catch (IOException e) {
      log.error("Couldn't read from url: " + url, e);
      throw new DataSourceException(ReasonType.INVALID_REQUEST, "Couldn't read from url: " + url);
    }
    DataTable dataTable = null;
    ULocale requestLocale = DataSourceHelper.getLocaleFromRequest(request);
    try {
      // Note: We assume that all the columns in the CSV file are text columns. In cases where the
      // column types are known in advance, this behavior can be overridden by passing a list of
      // ColumnDescription objects specifying the column types. See CsvDataSourceHelper.read() for
      // more details.
      dataTable = CsvDataSourceHelper.read(reader, null, true, requestLocale);
    } catch (IOException e) {
      log.error("Couldn't read from url: " + url, e);
      throw new DataSourceException(ReasonType.INVALID_REQUEST, "Couldn't read from url: " + url);
    }
    return dataTable;
  }
View Full Code Here

Examples of com.google.visualization.datasource.base.DataSourceException

    // Check for (!csv && !html && !tsv-excel) to make sure any output type
    // added in the future will be restricted to the same domain by default.
    OutputType outType = req.getDataSourceParameters().getOutputType();
    if (outType != OutputType.CSV && outType != OutputType.TSV_EXCEL
        && outType != OutputType.HTML && !req.isSameOrigin()) {
      throw new DataSourceException(ReasonType.ACCESS_DENIED,
          "Unauthorized request. Cross domain requests are not supported.");
    }
  }
View Full Code Here

Examples of com.google.visualization.datasource.base.DataSourceException

        return splitSortAndPagination(query);
      case SELECT:
        return splitSelect(query);
    }
    log.error("Capabilities not supported.");
    throw new DataSourceException(ReasonType.NOT_SUPPORTED, "Capabilities not supported.");
  }
View Full Code Here

Examples of com.google.visualization.datasource.base.DataSourceException

      buildRows(table, rs);
      return table;
    } catch (SQLException e) {
      String messageToUser = "Failed to execute SQL query. mySQL error message:"
          + " " + e.getMessage();
      throw new DataSourceException(
          ReasonType.INTERNAL_ERROR, messageToUser);
    } finally {
      if (stmt != null) {
        try {
          stmt.close();
View Full Code Here

Examples of com.google.visualization.datasource.base.DataSourceException

      // Connect to the database.
      // We should add connection pooling to avoid heavy creation of connections.
      con = DriverManager.getConnection(url, userName, password);
    } catch (SQLException e) {
      log.error("Failed to connect to database server.", e);
      throw new DataSourceException(
          ReasonType.INTERNAL_ERROR, "Failed to connect to database server.");
    }
    return con;
  }
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.