Package javax.ejb

Examples of javax.ejb.NoSuchEntityException


    prepStmt.setLong
        (offset++, ((Long)ctx.getPrimaryKey()).longValue());
    int rowCount = prepStmt.executeUpdate();
    myProcDef = null;
    if (rowCount == 0) {
        throw new NoSuchEntityException
      ("Storing row for DBId "
       + (Long)ctx.getPrimaryKey() + " failed.");
    }
      }
      if (((ProcessDataStore)paProcessData).isModified ()) {
View Full Code Here


     + (haveSelForUp.booleanValue() ? " FOR UPDATE" : ""));
      Long procKey = (Long)ctx.getPrimaryKey();
      prepStmt.setLong(1, procKey.longValue());
      rs = prepStmt.executeQuery();
      if (!rs.next()) {
    throw new NoSuchEntityException
        ("Row for id " + (Long)ctx.getPrimaryKey()
         + " not found in database.");
      }
      // read process from db
      int offset = 1;
View Full Code Here

                = "SELECT Xpdl FROM process WHERE DBId = ? ";
      prepStmt = con.prepareStatement(selectStatement);
      prepStmt.setLong(1, ((Long)ctx.getPrimaryKey()).longValue());
      rs = prepStmt.executeQuery();
      if (!rs.next()) {
    throw new NoSuchEntityException
        ("No process with DBId = " + ctx.getPrimaryKey());
      }
      return JDBCUtil.getString(ds, rs, 1);
  } catch (IOException e) {
      throw new EJBException (e);
View Full Code Here

      try {
         stmt.setInt(1, id);
         ResultSet rs = stmt.executeQuery();
         try {
            if (rs.next() == false)
               throw new NoSuchEntityException("EntityExc id " + id +
                                          " not found in database.");
            int ret = rs.getInt(1);

            if (debug)
               log.debug("EntityExcBean.get_val() returning " + ret);
View Full Code Here

         } // end of if ()
        
         ps.setInt(1, id.intValue());
         ResultSet rs = ps.executeQuery();
         if (rs.next() == false)
            throw new NoSuchEntityException("Account does not exist " + id.toString());
         this.balance = rs.getInt(1);
         this.customerId = (Integer)rs.getObject(2);
      }
      catch (Exception e)
      {
View Full Code Here

            {
               ps.setString(1, key);
               ResultSet rs = ps.executeQuery();

               if (rs.next() == false)
                  throw new NoSuchEntityException("Instance " +key +" not found in database.");
               name = rs.getString(1);
               rs.close();
            }
            finally
            {
View Full Code Here

     
         ps = getConnection().prepareStatement("SELECT NAME FROM CCBMPCUSTOMER WHERE ID = ?");
         ps.setInt(1, id.intValue());
         ResultSet rs = ps.executeQuery();
         if (rs.next() == false)
            throw new NoSuchEntityException("Customer does not exist " + id.toString());
         this.name = rs.getString(1);
         AccountLocalHome ah = (AccountLocalHome)new InitialContext().lookup("AccountLocal");
         accounts = ah.findByCustomerId(id);

      }
View Full Code Here

               ps.setString(1, pk.getKey());
               ResultSet rs = ps.executeQuery();

               if (rs.next() == false)
                  throw new NoSuchEntityException("Instance " + pk.getKey() +
                     " not found in database.");

               accountNumber = rs.getString(1);
               personsName = rs.getString(2);
            }
View Full Code Here

      ps.setDouble(1, balance);
      ps.setString(2, accountId);
      if (!(ps.executeUpdate() > 0)) {
        String error = "ejbStore: AccountBean (" + accountId + ") not updated";
        log(error);
        throw new NoSuchEntityException (error);
      }
    } catch(SQLException sqe) {
      log("SQLException:  " + sqe);
      throw new EJBException (sqe);
    } finally {
View Full Code Here

      ps = con.prepareStatement("delete from ejbAccounts where id = ?");
      ps.setString(1, accountId);
      if (!(ps.executeUpdate() > 0)) {
        String error = "AccountBean (" + accountId + " not found";
        log(error);
        throw new NoSuchEntityException (error);
      }
    } catch (SQLException sqe) {
      log("SQLException:  " + sqe);
      throw new EJBException (sqe);
    } finally {
View Full Code Here

TOP

Related Classes of javax.ejb.NoSuchEntityException

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.