Examples of TelescopeDAOException


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

   * @see org.xooof.xooofoscope.dao.ITelescopeDAO#exist(java.lang.Integer)
   */
  public STelescope fetchByPK(Integer telescopeId) throws DAOException {

    if (telescopeId == null) {
      throw new TelescopeDAOException("telescopeId cannot be null");
    }
    STelescope telescope = null;
    PreparedStatement statement = null;
    ResultSet result;   
    Connection connection = DAOHelper.getDBConnection();   
    try {   
      try
      {
        statement = connection.prepareStatement(FETCHBYPK_QRY);
        statement.setInt(1, telescopeId.intValue());
        result = statement.executeQuery();
        if(result.next())
        {
          telescope = new STelescope();
          telescope.setObjId(result.getString("id"));
          telescope.setObjClass(STelescope.class.getName());
          telescope.setName(result.getString("name"));
          telescope.setDescr(result.getString("description"));
        if(result.next())
        {
          throw new TelescopeDAOException("Multiple rows exists for telescopeId " + telescopeId.toString());
        }
        }
        else {    
          telescope = null;
        }
      }
      catch(SQLException exc)
      {
          throw new TelescopeDAOException(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 org.xooof.xooofoscope.dao.exception.TelescopeDAOException

        telescopeList.add(telescope);
        }
      }
      catch(SQLException exc)
      {
        throw new TelescopeDAOException(exc.getMessage());
      }//End catch IOException
    }
    // This code is to be executed each time in order to release DB Connections
    finally
    {
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.