Examples of connectIfNeeded()


Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

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.connectIfNeeded()

  }

  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.connectIfNeeded()

   * @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) {
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

   * @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;
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

   * @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;
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

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

    String sqls;
    try {
      sqls = ResourceHelper.readFromFile(clazz, fileName);
    } catch (FileNotFoundException e1) {
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

   * @return
   * @throws SQLException
   */
  public static <T> T query(String sql, Class<T> claz) {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = environment.createStatementWithBoundFixtureSymbols(sql);
      rs = st.executeQuery();
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

   * @return
   * @throws SQLException
   */
  public static <T> List<T> queryList(String sql, Class<T> clazz) {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = environment.createStatementWithBoundFixtureSymbols(sql);
      rs = st.executeQuery();
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

    }
  }

  public static <T> List<T> queryMapList(String sql) {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = environment.createStatementWithBoundFixtureSymbols(sql);
      rs = st.executeQuery();
View Full Code Here

Examples of org.jtester.module.database.environment.DBEnvironment.connectIfNeeded()

    }
  }

  public static <T> List<T> queryMapList(String sql, DataMap where) {
    DBEnvironment environment = DBEnvironmentFactory.getCurrentDBEnvironment();
    environment.connectIfNeeded();
    PreparedStatement st = null;
    ResultSet rs = null;
    try {
      st = environment.createStatementWithBoundFixtureSymbols(sql);
      int index = 1;
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.