Package org.openrdf.sail.rdbms.exceptions

Examples of org.openrdf.sail.rdbms.exceptions.RdbmsException


  {
    try {
      Class.forName("org.postgresql.Driver");
    }
    catch (ClassNotFoundException e) {
      throw new RdbmsException(e.toString(), e);
    }
    StringBuilder url = new StringBuilder();
    url.append("jdbc:postgresql:");
    if (serverName != null) {
      url.append("//").append(serverName);
View Full Code Here


    try {
      rs.close();
      stmt.close();
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

        return convert(rs);
      }
      return null;
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

    try {
      tableName = tables.getTableName(predId);
      present = tables.isPredColumnPresent(predId);
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
    JoinItem from = new JoinItem(alias, tableName, predId);

    ColumnVar s = createSubj(alias, subjVar, (Resource)subjValue);
    ColumnVar p = createPred(alias, predVar, (URI)predValue, !present);
    ColumnVar o = createObj(alias, objVar, objValue);
    ColumnVar c = createCtx(alias, ctxVar, (Resource)ctxValue);

    s.setTypes(tables.getSubjTypes(predId));
    o.setTypes(tables.getObjTypes(predId));

    SelectQuery query = new SelectQuery();
    query.setFrom(from);
    Map<String, ColumnVar> vars = new HashMap<String, ColumnVar>(4);
    for (ColumnVar var : new ColumnVar[] { s, p, o, c }) {
      from.addVar(var);
      Value value = var.getValue();
      if (vars.containsKey(var.getName())) {
        IdColumn existing = new IdColumn(vars.get(var.getName()));
        from.addFilter(new SqlEq(new IdColumn(var), existing));
      }
      else if (value != null && !var.isImplied()) {
        try {
          NumberValue vc = new NumberValue(vf.getInternalId(value));
          from.addFilter(new SqlEq(new RefIdColumn(var), vc));
        }
        catch (RdbmsException e) {
          throw new RdbmsException(e);
        }
      }
      else {
        vars.put(var.getName(), var);
      }
      if (!var.isHiddenOrConstant() && value == null) {
        SelectProjection proj = new SelectProjection();
        proj.setVar(var);
        proj.setId(new RefIdColumn(var));
        proj.setStringValue(coalesce(new URIColumn(var), new BNodeColumn(var), new LabelColumn(var),
            new LongLabelColumn(var), new LongURIColumn(var)));
        proj.setDatatype(new DatatypeColumn(var));
        proj.setLanguage(new LanguageColumn(var));
        query.addSqlSelectVar(proj);
      }
    }
    if (contexts.length > 0) {
      RdbmsResource[] ids = vf.asRdbmsResource(contexts);
      RefIdColumn var = new RefIdColumn(c);
      SqlExpr in = null;
      for (RdbmsResource id : ids) {
        NumberValue longValue;
        try {
          longValue = new NumberValue(vf.getInternalId(id));
        }
        catch (RdbmsException e) {
          throw new RdbmsException(e);
        }
        SqlEq eq = new SqlEq(var.clone(), longValue);
        if (in == null) {
          in = eq;
        }
View Full Code Here

  {
    try {
      return vf.getInternalId(predValue);
    }
    catch (RdbmsException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

        else {
          tripleTableManager.dropTripleIndexes();
        }
      }
      catch (SQLException e) {
        throw new RdbmsException(e);
      }
    }
  }
View Full Code Here

      literalManager.init();
      vf.setLiteralManager(literalManager);
      vf.setPredicateManager(predicateManager);
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

  {
    try {
      return !nsAndTableIndexes.isReadOnly();
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

      conn.setRdbmsQueryOptimizer(optimizer);
      conn.setLock(lock);
      return conn;
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

        nsAndTableIndexes.close();
        nsAndTableIndexes = null;
      }
    }
    catch (SQLException e) {
      throw new RdbmsException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.sail.rdbms.exceptions.RdbmsException

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.