Package nz.co.transparent.client.controller

Examples of nz.co.transparent.client.controller.GenericTransactionController


  public void findWhere() {
   
    Map columnMap = null;
    try {
      Connection conn = DataSourceHandler.getDataSource().getConnection();
      GenericTransactionController controller = new GenericTransactionController(conn);
      columnMap = controller.findWhere("title", "title_code = 'Mrs'");
      DbUtils.close(conn);
    } catch (FinderException ce) {
      System.out.println(ce.getMessage());
      return;
    } catch (ControllerException ce) {
View Full Code Here


    columnMap.put("date_updated", null);
    columnMap.put("updater_person_id", new Integer(3));
   
    try {
      Connection conn = DataSourceHandler.getDataSource().getConnection();
      GenericTransactionController controller = new GenericTransactionController(conn);
      if (controller.insertRecord("title", "title_id", columnMap) == 0) {
        conn.rollback();
      } else {
        conn.commit();
      }
      DbUtils.close(conn);
View Full Code Here

    columnMap.put("date_updated", null);
    columnMap.put("updater_person_id", new Integer(3));
   
    try {
      Connection conn = DataSourceHandler.getDataSource().getConnection();
      GenericTransactionController controller = new GenericTransactionController(conn);
      int result = controller.insertRecord("role", "role_code", columnMap);
      System.out.println("Number of records affected = " + result);
      conn.commit();
      DbUtils.close(conn);
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
View Full Code Here

  public void updateRecord() {
   
    try {
      Connection conn = DataSourceHandler.getDataSource().getConnection();
      GenericTransactionController controller = new GenericTransactionController(conn);
      Map columnMap = controller.findWhere("role", "role_code='A'");
      columnMap.put("role", "Test title is changed");
//      columnMap.put("role_code", "B");
//      columnMap.put("date_created", new Date());
//      columnMap.put("date_updated", new Date());
//      columnMap.put("updater_person_id", new Integer(3));
     
      controller.updateRecord("role", "role_code", columnMap);
      conn.commit();
      DbUtils.close(conn);
    } catch (FinderException ce) {
      System.out.println("FinderException: " + ce.getMessage());
      return;
View Full Code Here

  public void deleteRecord() {
   
    try {
      Connection conn = DataSourceHandler.getDataSource().getConnection();
      GenericTransactionController controller = new GenericTransactionController(conn);

      int result = controller.deleteRecord("role", "role_code='A'");
      System.out.println("Number of records affected = " + result);
      conn.commit();
     
      DbUtils.close(conn);
    } catch (ControllerException ce) {
View Full Code Here

TOP

Related Classes of nz.co.transparent.client.controller.GenericTransactionController

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.