Exemplo n.º 1
0
  /**
   * DOCUMENT ME!
   *
   * @return DOCUMENT ME!
   */
  public Object[] values() {
    try {
      RowSet index = this.indexView.locate(getKey());

      if (index != null) {
        return index.valuesAt(getColumn());
      } else {
        return EMPTY_ARRAY;
      }
    } catch (DatasetException e) {
      e.printStackTrace();
    }

    return null;
  }
Exemplo n.º 2
0
  /** @return */
  public static Dataset load() {
    Connection conn = new Connection();
    conn.setDriver("com.mysql.jdbc.Driver");
    conn.setUrl("jdbc:mysql://localhost:3306/iprint?useUnicode=true&characterEncoding=GBK");
    conn.setUser("root");
    conn.setPassword("admin");

    String sql = "select * from models order by model";

    SqlReader reader = new SqlReader(conn, sql);
    Dataset dataset = null;
    try {
      dataset = reader.read(ReportContext.getDefaultContext(), -1);
    } catch (DatasetException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    return dataset;
  }