Package com.eforce.baby.common.dao

Examples of com.eforce.baby.common.dao.DAOException


            rowCount = stmt.executeUpdate();
            log.debug("rowCount: " + rowCount);
        }
        catch(SQLException se)
        {
            throw new DAOException(se.getMessage());
        }
        finally
        {
            super.releaseConnection(con);
            super.cleanUp(null, stmt);
View Full Code Here


            stmt.setString(2, profileId);
            stmt.executeUpdate();
        }
        catch(SQLException se)
        {
            throw new DAOException(se.getMessage());
        }
        finally
        {
            super.releaseConnection(con);
            super.cleanUp(null, stmt);
View Full Code Here

            stmt.setString(2, profileId);
            stmt.executeUpdate();
        }
        catch(SQLException se)
        {
            throw new DAOException(se.getMessage());
        }
        finally
        {
            super.releaseConnection(con);
            super.cleanUp(null, stmt);
View Full Code Here

    }
    catch (SQLException e)
    {
      // TODO Auto-generated catch block
      log.error("Error: " + e);
      throw new DAOException( e.getMessage());
    }
    finally
    {
            super.cleanUp(rs,pStmt);
            super.releaseConnection(con);
View Full Code Here

      pStmt.setString( 1, distGroupVO.getDistGroupName() );
      ResultSet rset = null;
      rset = pStmt.executeQuery();
      if( rset.next() ){
        if(rset.getInt(1)>0){
          DAOException daox = new DAOException ("Database Error");
          daox.setMessageKey(IErrorMessageKeys.KEY_ERROR_DUPLICATE_DIST_GROUP);
          throw daox;
        }
      }

      sql = qManager.getFetchNewDistGroupIdQuery(dbType);
      log.debug(sql);
      distGroupVO.setId(this.getCurrentSequenceValue(con,sql));
      sql = qManager.getFetchNewDistGroupQuery(dbType);
      log.debug(sql);
      pStmt = con.prepareStatement( sql );

      pStmt.setString( 1, distGroupVO.getId() );
      pStmt.setString( 2, distGroupVO.getDistGroupName() );
      pStmt.setString( 3, distGroupVO.getDistGroupDesc());
      pStmt.setString( 4, distGroupVO.getIsEnabled());
      pStmt.executeUpdate();
     
      this.createSearchContent(con,dbType,distGroupVO,"TBL_DISTRIBUTION_GROUP","GROUP_ID");
     
      String[] userIds = EEMSUtil.convertToArray(distGroupVO.getUserNames(),IConstants.EEMS_DELIMITER);
      if(userIds!=null)
      {
        sql = qManager.getFetchDistGroupUserQuery(dbType);
        pStmt = con.prepareStatement( sql );
        log.debug(sql);
       
        for (int i=0; i<userIds.length;i++)
        {
          if(userIds[i]!= null)
          {
            log.debug("userID " + userIds[i]);
            log.debug("groupid "+distGroupVO.getId());
            pStmt.setString( 1, userIds[i].trim() );
            pStmt.setString( 2, distGroupVO.getId() );
            pStmt.executeUpdate();
            log.debug("user-group added" + i);
          }
        }
       
      }
     
     
     
      log.debug("inserted...and returning");
      con.commit();
    }
    catch(SQLException ex)
    {
      try
      {
        con.rollback();
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error: " + e);
      }
      DAOException daox = new DAOException ("Database Error");
      daox.setMessageKey(IErrorMessageKeys.KEY_DATABASE_ERROR);
      throw daox;
 
    }
    finally
    {
      try
      {
        if(pStmt != null)
                    pStmt.close();
        this.releaseConnection(con);
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        DAOException daox = new DAOException ("FATAL Error");
        daox.setMessageKey(IErrorMessageKeys.KEY_FATAL_ERROR);
        throw daox;
      }
 
 
    }
View Full Code Here

       log.debug("users="+users);
     }
     catch (Exception e)
     {
       // TODO Auto-generated catch block
       throw new DAOException(e.getMessage());
   
     }
    finally
    {
      super.cleanUp(rset,pstmt);
View Full Code Here

      pStmt.setString( 2, distGroupVO.getDistGroupName() );
      ResultSet rset = null;
      rset = pStmt.executeQuery();
      if( rset.next() ){
        if(rset.getInt(1)>0){
          DAOException daox = new DAOException ("Database Error");
          daox.setMessageKey(IErrorMessageKeys.KEY_ERROR_DUPLICATE_DIST_GROUP);
          throw daox;
        }
      }

      sql = qManager.getUpdateDistGroupQuery(dbType);
      log.debug(sql);
      pStmt = con.prepareStatement( sql );
      pStmt.setString( 1, distGroupVO.getDistGroupName() );
      pStmt.setString( 2, distGroupVO.getDistGroupDesc() );
      pStmt.setString( 3, distGroupVO.getIsEnabled());
      pStmt.setString( 4, distGroupVO.getId());
     
      pStmt.executeUpdate();
        this.createSearchContent(con,dbType,distGroupVO,"TBL_DISTRIBUTION_GROUP","GROUP_ID");
      //first delete old users
      sql = qManager.getDeleteDistGroupUserQuery(dbType);
      pStmt = con.prepareStatement( sql );
      pStmt.setString( 1, distGroupVO.getId());
      pStmt.executeUpdate();
     
      String[] userIds = EEMSUtil.convertToArray(distGroupVO.getUserNames(),IConstants.EEMS_DELIMITER);
      if(userIds!=null)
      {
        sql = qManager.getFetchDistGroupUserQuery(dbType);
        pStmt = con.prepareStatement( sql );
        log.debug(sql);
 
        for (int i=0; i<userIds.length;i++)
        {
          if(userIds[i]!= null)
          {
            log.debug("userID " + userIds[i]);
            log.debug("groupid "+distGroupVO.getId());
            pStmt.setString( 1, userIds[i].trim() );
            pStmt.setString( 2, distGroupVO.getId() );
            pStmt.executeUpdate();
            log.debug("user-group added" + i);
          }
        }
 
      }
      log.debug("inserted...and updated");
      con.commit();
    }
    catch(SQLException ex)
    {
      try
      {
        con.rollback();
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error: " + e);
      }
      DAOException daox = new DAOException ("Database Error");
      daox.setMessageKey(IErrorMessageKeys.KEY_DATABASE_ERROR);
      throw daox;
    }
    finally
    {
      try
      {
        if(pStmt!=null) pStmt.close();
        this.releaseConnection(con);
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error: " + e);
        DAOException daox = new DAOException ("FATAL Error");
        daox.setMessageKey(IErrorMessageKeys.KEY_FATAL_ERROR);
        throw daox;
      }


    }
View Full Code Here

      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error: " + e);
      }
      DAOException daox = new DAOException ("Database Error");
      daox.setMessageKey(IErrorMessageKeys.KEY_DATABASE_ERROR);
      throw daox;
    }
    finally
    {
      try
      {
        if(pStmt != null) pStmt.close();
        this.releaseConnection(con);
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        log.error("Error: " + e);
        DAOException daox = new DAOException ("FATAL Error");
        daox.setMessageKey(IErrorMessageKeys.KEY_FATAL_ERROR);
        throw daox;
      }
 
 
    }
View Full Code Here

        log.debug("inserted...and updated");
      }
      else
      {
        log.debug("Duplicate User ID found ....aborting...";
        DAOException daox = new DAOException ("Duplicate User");
        daox.setMessageKey(IErrorMessageKeys.KEY_DUPLICATE_USER);
        throw daox;
      }
     
      con.commit();
    }
    catch(SQLException ex)
    {
      try
      {
        con.rollback();
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      DAOException daox = new DAOException ("Database Error");
      daox.setMessageKey(IErrorMessageKeys.KEY_DATABASE_ERROR);
      throw daox;
    }
       
    finally
    {
      try
      {
        if(pStmt!=null) pStmt.close();
        this.releaseConnection(con);
      }
      catch (SQLException e)
      {
        // TODO Auto-generated catch block
        e.printStackTrace();
        DAOException daox = new DAOException ("FATAL Error");
        daox.setMessageKey(IErrorMessageKeys.KEY_FATAL_ERROR);
        throw daox;
      }
 
 
    }
View Full Code Here

     
    }
    catch (Exception e)
    {
      // TODO Auto-generated catch block
      throw new DAOException(e.getMessage());
 
    }
    finally
    {
      if( rset!= null )
View Full Code Here

TOP

Related Classes of com.eforce.baby.common.dao.DAOException

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.