Package javax.ejb

Examples of javax.ejb.CreateException


        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here


        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here

            Product p = ph.create();
        } catch (CreateException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            throw new CreateException("hosed");
        }
    }
View Full Code Here

            ProductLocal p = ph.create();
        } catch (CreateException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            throw new CreateException("hosed");
        }
    }
View Full Code Here

    public void ejbPostCreateWithOrderId(Long orderId) throws CreateException {
        try {
            getOrderHome().findByPrimaryKey(orderId).getLineItems().add(ctx.getEJBLocalObject());
        } catch (FinderException e) {
            throw new CreateException(e.getMessage());
        }
    }
View Full Code Here

        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here

                    c.add(b1);
                    break;
            }

        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
    }
View Full Code Here

      // Our bean has many customers, use the cmr set method here..
      Set customers = new HashSet();
      customers.add(custL);
      this.setCustomers(customers);
        } catch (RemoteException re) {
            throw new CreateException("Invalid Customer - Bad Remote Reference");
        } catch (FinderException fe) {
            throw new CreateException("Invalid Customer - Unable to Find Local Reference");
        } catch (NamingException ne) {
            throw new CreateException("Invalid Customer - Unable to find CustomerHomeLocal Reference");
        }
    }
View Full Code Here

      // Our bean has many customers, use the cmr set method here..
      Set customers = new HashSet();
      customers.add(custL);
      this.setCustomers(customers);
        } catch (RemoteException re) {
            throw new CreateException("Invalid Customer - Bad Remote Reference");
        } catch (FinderException fe) {
            throw new CreateException("Invalid Customer - Unable to Find Local Reference");
        } catch (NamingException ne) {
            throw new CreateException("Invalid Customer - Unable to find CustomerHomeLocal Reference");
        }
    }
View Full Code Here

        int capacity, double tonnage)
        throws CreateException {

    System.out.println("ejbCreate() pk="+id+" name="+name);
        if ((id.intValue() < 1) || (name == null))
           throw new CreateException("Invalid Parameters");
        this.id = id;
        this.name = name;
        this.capacity = capacity;
        this.tonnage = tonnage;
       
        Connection con = null;
        PreparedStatement ps = null;
        try {
          con = this.getConnection();
          System.out.println("Obtained Connection: Trying to create statement");

          ps = con.prepareStatement("insert into"+"\""+"Ship"+"\""+ " (id, name, capacity, tonnage) values (?,?,?,?)");
          ps.setInt(1, id.intValue());
          ps.setString(2, name);
          ps.setInt(3, capacity);
          ps.setDouble(4, tonnage);
          if (ps.executeUpdate() != 1) {
            throw new CreateException ("Failed to add Ship to database");
          }
           return id;
        }
        catch (SQLException se) {
            throw new EJBException (se);
View Full Code Here

TOP

Related Classes of javax.ejb.CreateException

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.