Package jodd.db

Examples of jodd.db.DbSession.closeSession()


        return true;
    } catch (Exception ignored) {
      return false;
    } finally {
      query.close();
      dbSession.closeSession();
    }
  }

  /**
   * Installs database from the script.
View Full Code Here


      }
      DbQuery query = new DbQuery(dbSession, q);
      query.executeUpdate();
      log.debug("executed query #" + (i + 1));
    }
    dbSession.closeSession();
  }

  /**
   * Inserts questions and deal with time.
   */
 
View Full Code Here

      DbQuery query = new DbQuery(dbSession, q);
      query.executeUpdate();
      log.debug("executed query #" + (i + 1));
    }

    dbSession.closeSession();
  }


  private void insertAnswers() {
    DbSession dbSession = AppCore.ref.createDbSession();
View Full Code Here

    Girl dbGirl = appDao.findById(Girl.class, 1);
    assertEquals("Guitar", dbGirl.getSpeciality());
    assertEquals("Emma", dbGirl.getName());

    session.closeSession();
    ThreadDbSessionHolder.remove();
  }
}
View Full Code Here

    assertNotNull(appDao.findById(Girl.class, 1));
    assertNotNull(appDao.findById(Girl.class, 2));
    assertNotNull(appDao.findById(Girl.class, 3));

    session.closeSession();
    ThreadDbSessionHolder.remove();
  }

}
View Full Code Here

    DbOomQuery dbOomQuery = DbOomQuery.query(session, DbEntitySql.insert(tester2));
    dbOomQuery.setGeneratedKey();
    int result = dbOomQuery.executeUpdate();

    assertEquals(1, result);
    session.closeSession();

    return tester2;
  }

  protected void loadEntry(Tester2 tester2) {
View Full Code Here

    assertEquals(tester2.value, tester21.value);
    assertEquals(tester2.name, tester21.name);
    assertEquals(tester2.time, tester21.time);
    assertEquals(tester2.time2, tester21.time2);

    session.closeSession();
  }

}
View Full Code Here

        "primary key (ID)," +
        "FOREIGN KEY (GIRL_ID) REFERENCES GIRL (ID)" +
        ')';

    executeUpdate(session, sql);
    session.closeSession();
  }

  @After
  public void tearDown() throws Exception {
    dbtxm.close();
View Full Code Here

      String sql = getCreateTableSql();

      DbQuery query = new DbQuery(session, sql);
      query.executeUpdate();

      session.closeSession();
      assertTrue(query.isClosed());
    }

    protected void close() {
      DbSession session = new DbSession();
View Full Code Here

      DbSession session = new DbSession();

      DbQuery query = new DbQuery(session, "drop table " + getTableName());
      query.executeUpdate();

      session.closeSession();
      assertTrue(query.isClosed());

      connectionPool.close();
    }
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.