Package de.fuberlin.wiwiss.d2rq

Examples of de.fuberlin.wiwiss.d2rq.D2RQException


      /* JDBC 4+ requires manual closing of result sets and statements */
      if (this.resultSet != null) {
      try {
        this.resultSet.close();
      } catch (SQLException ex) {
        throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
      }
      }
     
      if (this.database != null) {
      try {
        this.database.vendor().beforeClose(this.database.connection());
      } catch (SQLException ex) {
        throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
      }
      }
      if (this.statement != null) {
      try {
        this.statement.close();
      } catch (SQLException ex) {
        throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
      }
      }

      if (this.database != null) {
      try {
        this.database.vendor().afterClose(this.database.connection());
      } catch (SQLException ex) {
        throw new D2RQException(ex.getMessage() + "; query was: " + this.sql);
      }
      }
  }
View Full Code Here


        } catch (SQLException ex) {
          if (cancelled) {
            log.debug("SQL query execution cancelled", ex);
            throw new QueryCancelledException();
          }
          throw new D2RQException(ex.getMessage() + ": " + this.sql);
        }
    }
View Full Code Here

   * @param qualifiedName The attribute's name
   */
  public static Attribute parseAttribute(String qualifiedName) {
    Matcher match = attributeRegexLax.matcher(qualifiedName);
    if (!match.matches()) {
      throw new D2RQException("Attribute \"" + qualifiedName +
          "\" is not in \"[schema.]table.column\" notation",
          D2RQException.SQL_INVALID_ATTRIBUTENAME);
    }
    return new Attribute(match.group(1), match.group(2), match.group(3));
  }
View Full Code Here

   * @param qualifiedName The relation's name
   */
  public static RelationName parseRelationName(String qualifiedName) {
    Matcher match = relationNameRegex.matcher(qualifiedName);
    if (!match.matches()) {
      throw new D2RQException("Relation name \"" + qualifiedName +
          "\" is not in \"[schema.]table\" notation",
          D2RQException.SQL_INVALID_RELATIONNAME);
    }
    return new RelationName(match.group(1), match.group(2));
  }
View Full Code Here

   * Constructs an Alias from an SQL "foo AS bar" expression.
   */
  public static Alias parseAlias(String aliasExpression) {
    Matcher matcher = aliasPattern.matcher(aliasExpression);
    if (!matcher.matches()) {
      throw new D2RQException("d2rq:alias '" + aliasExpression +
          "' is not in 'table AS alias' form", D2RQException.SQL_INVALID_ALIAS);
    }
    return new Alias(SQL.parseRelationName(matcher.group(1)),
        SQL.parseRelationName(matcher.group(2)));
  }
View Full Code Here

        if (-1 != (index = joinCondition.indexOf(Join.joinOperators[joinOperator])))
          break;
      }

      if (index == -1) {
        throw new D2RQException("d2rq:join \"" + joinCondition +
            "\" is not in \"table1.col1 [ <= | => | = ] table2.col2\" form",
            D2RQException.SQL_INVALID_JOIN);
      }
     
      Attribute leftSide = SQL.parseAttribute(joinCondition.substring(0, index).trim());
View Full Code Here

  public String rdfType() {
    return null;
  }
  @Override
  public String toSQLLiteral(String value) {
    throw new D2RQException("Attempted toSQLLiteral('" + value +
        "') on a column of a datatype that cannot be mapped to RDF",
        D2RQException.DATATYPE_UNMAPPABLE);
  }
View Full Code Here

        "') on a column of a datatype that cannot be mapped to RDF",
        D2RQException.DATATYPE_UNMAPPABLE);
  }
  @Override
  public String value(ResultSet resultSet, int column) throws SQLException {
    throw new D2RQException("Attempted to get value of a datatype that cannot be mapped to RDF",
        D2RQException.DATATYPE_UNMAPPABLE);
  }
View Full Code Here

      log.info("Done reading D2RQ map with " +
          mapping.databases().size() + " databases and " +
          mapping.classMapResources().size() + " class maps");
      return this.mapping;
    } catch (LiteralRequiredException ex) {
      throw new D2RQException("Expected literal, found URI resource instead: " + ex.getMessage(),
          D2RQException.MAPPING_RESOURCE_INSTEADOF_LITERAL);
    } catch (ResourceRequiredException ex) {
      throw new D2RQException("Expected URI, found literal instead: " + ex.getMessage(),
          D2RQException.MAPPING_LITERAL_INSTEADOF_RESOURCE);
    }
  }
View Full Code Here

        return fileName;
      }
      return new File(fileName).getAbsoluteFile().toURI().normalize()
          .toString();
    } catch (URISyntaxException ex) {
      throw new D2RQException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of de.fuberlin.wiwiss.d2rq.D2RQException

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.