Package no.priv.garshol.duke

Examples of no.priv.garshol.duke.DukeException


  private String parsebnode() {
    int start = pos;

    pos++; // skip '_'
    if (line.charAt(pos++) != ':')
      throw new DukeException("Incorrect start of blank node");

    char ch = line.charAt(pos++);
    while ((ch >= 'A' && ch <= 'Z') ||
           (ch >= 'a' && ch <= 'z') ||
           (ch >= '0' && ch <= '9'))
View Full Code Here


        continue;

      return v;
    }

    throw new DukeException("No identity for record " + r);
  }
View Full Code Here

        row = csv.next();
      }
     
      csv.close();
    } catch (IOException e) {
      throw new DukeException("Error loading mapping file " + filename, e);
    }
  } 
View Full Code Here

        csv.setSeparator(separator);
      return new CSVRecordIterator(csv);
    } catch (FileNotFoundException e) {
      throw new DukeConfigException("Couldn't find CSV file '" + file + "'");
    } catch (IOException e) {
      throw new DukeException(e);
    }
  }
View Full Code Here

          header[ix] = "" + (ix + 1);
      }

      // what if there is no header?
      if (hasheader && !getColumns().isEmpty() && header == null)
        throw new DukeException("CSV file contained no header");

      // build the 'index' and 'column' indexes
      int count = 0;
      for (Column c : getColumns()) {
        boolean found = false;
View Full Code Here

          // ugly, but probably the only way to get around this.
          // http://stackoverflow.com/questions/12845385/duke-fast-deduplication-java-lang-unsupportedoperationexception-operation-not
          rs.close();
        }
      } catch (SQLException e) {
        throw new DukeException(e);
      }
      JDBCUtils.close(stmt);
    }
View Full Code Here

      Context ctx = new InitialContext();
      DataSource ds = (DataSource) ctx.lookup(jndiPath);
      Connection conn = ds.getConnection();
      return conn.createStatement();
    } catch (NamingException e) {
      throw new DukeException("No database configuration found via JNDI at " +
                              jndiPath, e);
    } catch (SQLException e) {
      throw new DukeException("Error connecting to database via " +
                              jndiPath, e);
    }
  }
View Full Code Here

                               Properties props) {
    try {
      Driver driver = (Driver) ObjectUtils.instantiate(driverklass);
      Connection conn = driver.connect(jdbcuri, props);
      if (conn == null)
        throw new DukeException("Couldn't connect to database at " +
                                   jdbcuri);
      return conn.createStatement();

    } catch (SQLException e) {
      throw new DukeException(e);
    }
  }
View Full Code Here

        stmt.close();
      }
      if (conn != null && !conn.isClosed())
        conn.close();
    } catch (SQLException e) {
      throw new DukeException(e);
    }
  }
View Full Code Here

        return rs.getInt(1);
      } finally {
        rs.close();
      }
    } catch (SQLException e) {
      throw new DukeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of no.priv.garshol.duke.DukeException

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.