大家看看有没有错误

public boolean addZcBm(ZcBmVo vo) throws Exception {
Connection conn = null;
DbTransaction trans = new DbTransaction();
trans.begin();
conn = DbSession.current().getConnection();
try {

ZcBmVo zVo = dao.getZcBmByWyBsm(conn, vo.getWyBsm());
if(zVo != null){//已存在唯一标识码
return true;
}
long id = dao.getNextSequ(conn, ZcBmVo.SEQUENCES);
vo.setId(id);
vo.setSfcz("N");
vo.setSfdj("N");
dao.addZcBm(conn, vo);
trans.commit();
return false;
} catch (Exception e) {
trans.rollback();
e.printStackTrace();
throw e;
}
}

大家看看有什么错误没

你可能感兴趣的:(java基础,java,方法代码片段,数据库连接)