Package org.jtester.module.dbfit.db.model

Examples of org.jtester.module.dbfit.db.model.DataTable


    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = dbEnvironment.createStatementWithBoundFixtureSymbols(query);
      rs = st.executeQuery();
      DataTable dt = new DataTable(rs);
      return dt;
    } finally {
      DBHelper.closeResultSet(rs);
      rs = null;
      DBHelper.closeStatement(st);
View Full Code Here


    } else {
      String err = "Stored queries can only be used on symbols that contain result sets";
      throw new UnsupportedOperationException(err);
    }
    try {
      DataTable dt = new DataTable(rs);
      return dt;
    } finally {
      DBHelper.closeResultSet(rs);
      rs = null;
    }
View Full Code Here

    } else {
      throw new UnsupportedOperationException("Cannot load stored query from " + symbolName
          + " - object type is " + o.getClass().getName());
    }
    try {
      DataTable dt = new DataTable(rs);
      return dt;
    } catch (Exception e) {
      throw new UnsupportedOperationException("Cannot load stored query from " + symbolName, e);
    } finally {
      DBHelper.closeResultSet(rs);
View Full Code Here

    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = dbEnvironment.createStatementWithBoundFixtureSymbols(query);
      rs = st.executeQuery();
      DataTable dt = new DataTable(rs);
      org.jtester.fit.util.SymbolUtil.setSymbol(symbolName, dt);
    } catch (Exception sqle) {
      throw new Error(sqle);
    } finally {
      DBHelper.closeResultSet(rs);
View Full Code Here

    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = dbEnvironment.createStatementWithBoundFixtureSymbols(query);
      rs = st.executeQuery();
      DataTable dt = new DataTable(rs);

      int rowSize = dt.getRowSize();
      if (rowSize == 0) {
        throw new RuntimeException("can't retrieve any data by query:" + query);
      } else if (rowSize > 1) {
        throw new RuntimeException("allowing one row data retrieved by query:" + query);
      }
      int colSize = dt.getColSize();
      if (colSize == 0) {
        throw new RuntimeException("can't retrieve any column by query:" + query);
      } else if (colSize > 1) {
        throw new RuntimeException("allowing one column data retrieved by query:" + query);
      }
      DataRow row = dt.getUnprocessedRows().get(0);
      List<String> values = row.getStringValues();
      org.jtester.fit.util.SymbolUtil.setSymbol(symbolName, values.get(0));
    } catch (Exception sqle) {
      throw new Error(sqle);
    } finally {
View Full Code Here

TOP

Related Classes of org.jtester.module.dbfit.db.model.DataTable

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.