Package com.boco.bomc.vpn.db.exception

Examples of com.boco.bomc.vpn.db.exception.DBException


 
  public Connection getConnection(){
    try{
      return DBManager.getConnection();
    }catch(SQLException e){
      throw new DBException(e);
    }
  }
View Full Code Here


      DatabaseMetaData mdm = conn.getMetaData();
      log.info("Connected to " + mdm.getDatabaseProductName() +
                              " " + mdm.getDatabaseProductVersion());
      closeConnection();
    } catch (Exception e) {
      throw new DBException(e);
    }
  }
View Full Code Here

  /** 开启事务 */ 
    public static void beginTransaction() throws DaoException
        try {   
          getConnection().setAutoCommit(false)//把事务提交方式改为手工提交 
        } catch (SQLException e) { 
            throw new DBException("开户事务时出现异常")
       
    } 
View Full Code Here

    /** 提交事务并关闭连接 */ 
    public static void commitAndClose() throws DaoException
        try
          getConnection().commit(); //提交事务 
        } catch (SQLException e) { 
            throw new DBException("提交事务时出现异常")
        }finally
          closeConnection()
       
    } 
View Full Code Here

    /** 回滚并关闭连接 */ 
    public static void rollbackAndClose()throws DaoException
        try
          getConnection().rollback()
        } catch (SQLException e) { 
            throw new DBException("回滚事务时出现异常",e)
        }finally
          closeConnection()
       
    } 
View Full Code Here

TOP

Related Classes of com.boco.bomc.vpn.db.exception.DBException

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.