Examples of DBEnvironment


Examples of org.jtester.module.database.environment.DBEnvironment

    DBEnvironment environment = workingEnvironment();
    return new InspectFixture(environment, InspectFixture.MODE_TABLE, tableName);
  }

  public Fixture inspectView(String tableName) {
    DBEnvironment environment = workingEnvironment();
    return new InspectFixture(environment, InspectFixture.MODE_TABLE, tableName);
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

    DBEnvironment environment = workingEnvironment();
    return new InspectFixture(environment, InspectFixture.MODE_TABLE, tableName);
  }

  public Fixture inspectQuery(String query) {
    DBEnvironment environment = workingEnvironment();
    return new InspectFixture(environment, InspectFixture.MODE_QUERY, query);
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

   * @param query
   * @param symbolName
   * @return
   */
  public Fixture storeQueryTable(String query, String symbolName) {
    DBEnvironment environment = workingEnvironment();
    return new StoreQueryTableFixture(environment, query, symbolName);
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

    DBEnvironment environment = workingEnvironment();
    return new StoreQueryTableFixture(environment, query, symbolName);
  }

  public Fixture compareStoredQueries(String symbol1, String symbol2) {
    DBEnvironment environment = workingEnvironment();
    return new CompareStoredQueriesFixture(environment, symbol1, symbol2);
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

   * 返回当前的数据库环境
   *
   * @return
   */
  public DBEnvironment workingEnvironment() {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    return environment;
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

@SuppressWarnings({ "unchecked", "rawtypes" })
public class SqlRunner {

  public static void commit() {
    try {
      DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
      environment.connectIfNeeded();
      environment.commit();
    } catch (Exception e) {
      throw ExceptionWrapper.getUndeclaredThrowableExceptionCaused(e);
    }
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

    }
  }

  public static void rollback() {
    try {
      DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
      environment.connectIfNeeded();
      environment.rollback();
    } catch (Exception e) {
      throw ExceptionWrapper.getUndeclaredThrowableExceptionCaused(e);
    }
  }
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

   *
   * @param sql
   * @throws SQLException
   */
  public static void execute(String sql) {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();
    PreparedStatement st = null;
    try {
      st = environment.createStatementWithBoundFixtureSymbols(sql);
      st.execute();
    } catch (Throwable e) {
      throw ExceptionWrapper.getUndeclaredThrowableExceptionCaused(e);
    } finally {
      DBHelper.closeStatement(st);
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

   * @param fileName
   * @throws SQLException
   * @throws FileNotFoundException
   */
  public static void executeFromFile(String fileName) throws Exception {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();

    String sqls = ResourceHelper.readFromFile(fileName);
    String[] statements = DBHelper.parseSQL(sqls);
    for (String statment : statements) {
      PreparedStatement st = null;
      try {
        st = environment.createStatementWithBoundFixtureSymbols(statment);
        st.execute();
      } catch (Throwable e) {
        throw new DbFitException("there are some error when execute sql file [" + fileName + "]", e);
      } finally {
        DBHelper.closeStatement(st);
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment

   *
   * @param is
   * @throws Exception
   */
  public static void executeFromStream(InputStream is) throws Exception {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();

    String sqls = ResourceHelper.readFromStream(is);
    String[] statements = DBHelper.parseSQL(sqls);
    for (String statment : statements) {
      PreparedStatement st = null;
      try {
        st = environment.createStatementWithBoundFixtureSymbols(statment);
        st.execute();
      } catch (Throwable e) {
        throw new DbFitException("there are some error when execute sql file.", e);
      } finally {
        DBHelper.closeStatement(st);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.