Examples of DAOException


Examples of org.mybeans.dao.DAOException

      BeanTable<MedLog> MedTable = BeanTable.getInstance(MedLog.class, "Logmedication_table");
      if(!MedTable.exists()) MedTable.create("medId");
      MedTable.setIdleConnectionCleanup(true);
      factory = MedTable.getFactory();
    }catch(BeanFactoryException e){
      throw new DAOException(e);
    }
  }
View Full Code Here

Examples of org.nutz.dao.DaoException

        st.onAfter(conn, null);
      }
    }
    // If any SQLException happend, throw out the SQL string
    catch (SQLException e) {
      throw new DaoException(format"!Nutz SQL Error: '%s'\nPreparedStatement: \n'%s'",
                      st.toString(),
                      st.toPreparedStatement()), e);
    }

  }
View Full Code Here

Examples of org.nutz.dao.DaoException

            catch (SQLException e1) {
              if (log.isErrorEnabled())
                log.error(e1);
            }
          }
        throw new DaoException(e);
      }
    }
    // 无事务
    else {
      Connection conn = null;
      boolean old = false;
      // 开始一个连接
      try {
        conn = dataSource.getConnection();
        // 多条语句运行,将自动提交设为 false
        old = conn.getAutoCommit();
        conn.setAutoCommit(false);
        // 开始循环运行
        callback.invoke(conn);
        // 完成提交
        if (!conn.getAutoCommit())
          conn.commit();
      }
      // 异常回滚
      catch (Exception e) {
        try {
          conn.rollback();
        }
        catch (SQLException e1) {}// TODO 简单记录一下?
        throw new DaoException(e);
      }
      // 保证释放资源
      finally {
        if (null != conn) {
          // 恢复链接自动提交设定
View Full Code Here

Examples of org.sf.bee.persistence.dao.exceptions.DaoException

                    _entityClass,
                    id);
            return entity;
        } catch (Throwable t) {
            final Throwable cause = ExceptionUtils.getRealCause(t);
            throw new DaoException(cause.getMessage(), cause);
        }
    }
View Full Code Here

Examples of org.tamacat.dao.DaoException

        try {
          String url = getUrl();
          LOG.trace("JDBC URL: " + url);
            return DriverManager.getConnection(url, getUser(), getPassword());
        } catch (SQLException e) {
            throw new DaoException(e);
        }
    }
View Full Code Here

Examples of org.xooof.xooofoscope.dao.exception.DAOException

  }
 
  protected static Integer getSequenceNextVal(String sequenceName) throws DAOException {
   
    if (sequenceName == null) {
      throw new DAOException("sequenceName cannot be null");
    }
    Integer nextval=null;
    PreparedStatement statement = null;
    ResultSet result;  
    Connection connection = DAOHelper.getDBConnection();   
    try {  
      try
      {
      statement = connection.prepareStatement(NEXTVAL_QRY);
      statement.setString(1, sequenceName);
      result = statement.executeQuery();
      if(result.next())
      {
        nextval = new Integer(result.getInt("nextval"));
        if(result.next())
        {
        throw new DAOException("Multiple rows returned for nextval sequence '"+sequenceName+"'");
        }
      }
      else {    
        throw new DAOException("Selection of nextval for sequence '" + sequenceName + "' returned no row");
      }
      }
      catch(SQLException exc)
      {
        throw new DAOException(exc.getMessage());
      }//End catch IOException
    }
    // This code is to be executed each time in order to release DB Connections
    finally
    {
View Full Code Here

Examples of sino.dao.DaoException

        try {
            result = (T) query.getSingleResult();

            return result;
        } catch (NonUniqueResultException e) {
            throw new DaoException("The query '" + query + "' should get a single result. Error message: "
                    + e.getMessage(), e);
        } catch (NoResultException e) {
            return null;
        } catch (RuntimeException e) {
            throw new DaoException("Cannot run query '" + query + "'. Runtime exception: " + e.getMessage(), e);
        } finally {
            logQueryResult(startTime, result);
        }
    }
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.