Package org.apache.juddi.util.jdbc

Examples of org.apache.juddi.util.jdbc.Transaction


    keysIn.add("901b15c5-799c-4387-8337-a1a35fceb791");
    keysIn.add("80fdae14-0e5d-4ea6-8eb8-50fde422056d");
    keysIn.add("e1996c33-c436-4004-9e3e-14de191bcc6b");
    keysIn.add("3ef4772f-e04b-46ed-8065-c5a4e167b5ba");

    Transaction txn = new Transaction();

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        FindBusinessByNameQuery.select(names,keysIn,null,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here


    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("www.jUDDI.org");

        Vector contactList = new Vector();
        Contact contact = null;

        contact = new Contact("Steve Viens");
        contact.setUseType("sales");
        contactList.add(contact);

        contact = new Contact("Marley Viens");
        contact.setUseType("support");
        contactList.add(contact);

        contact = new Contact("Chris Michaels");
        contact.setUseType("marketing");
        contactList.add(contact);

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a Collection of Contact objects
        ContactTable.insert(businessKey, contactList, connection);

        // select a Collection Contact objects by BusinessKey
        contactList = ContactTable.select(businessKey, connection);

        System.out.println(contactList.size() +
          " contacts for BusinessKey: "+businessKey);

        // delete a Collection Contact objects by BusinessKey
        ContactTable.delete(businessKey, connection);

        // re-select a Collection Contact objects by BusinessKey
        contactList = ContactTable.select(businessKey, connection);

        System.out.println(contactList.size() +
          " contacts for BusinessKey: "+businessKey);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        String serviceKey = uuidgen.uuidgen();
        BusinessService service = new BusinessService();
        service.setBusinessKey(businessKey);
        service.setServiceKey(serviceKey);

        String bindingKey = uuidgen.uuidgen();
        BindingTemplate binding = new BindingTemplate();
        binding.setServiceKey(serviceKey);
        binding.setBindingKey(bindingKey);
        binding.setAccessPoint(
          new AccessPoint("http://www.juddi.org/bindingtemplate.html", "http"));

        Vector infoList = new Vector();
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        int infoID = 0;

        Vector descList = new Vector();
        descList.add(new Description("blah, blah, blah", "en"));
        descList.add(new Description("Yadda, Yadda, Yadda", "it"));
        descList.add(new Description("WhoobWhoobWhoobWhoob", "cy"));
        descList.add(new Description("Haachachachacha", "km"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new BusinessService
        BusinessServiceTable.insert(service, connection);

        // insert a new BindingTemplate
        BindingTemplateTable.insert(binding, connection);

        // insert a Collection of TModelInstanceInfo objects
        TModelInstanceInfoTable.insert(bindingKey, infoList, connection);

        // insert a Collection of Description objects
        TModelInstanceInfoDescTable.insert(
          bindingKey,
          infoID,
          descList,
          connection);

        // select a Collection of Description objects (by BindingKey)
        descList =
          TModelInstanceInfoDescTable.select(bindingKey, infoID, connection);

        // delete a Collection of Description objects (by BindingKey)
        TModelInstanceInfoDescTable.delete(bindingKey, connection);

        // re-select a Collection of Description objects (by BindingKey)
        descList =
          TModelInstanceInfoDescTable.select(bindingKey, infoID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector contactList = new Vector();
        Contact contact = new Contact("Billy Bob");
        contact.setUseType("server");
        contactList.add(contact);
        int contactID = 0;

        Vector emailList = new Vector();
        Email email = null;

        email = new Email("support@steveviens.com");
        email.setUseType("Support");
        emailList.add(email);

        email = new Email("marketing@steveviens.com");
        email.setUseType("Advertising");
        emailList.add(email);

        email = new Email("info@steveviens.com");
        email.setUseType("Information");
        emailList.add(email);

        email = new Email("admin@steveviens.com");
        email.setUseType("Administration");
        emailList.add(email);

        email = new Email("webmaster@steveviens.com");
        email.setUseType("Web Master");
        emailList.add(email);

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new Contact
        ContactTable.insert(businessKey, contactList, connection);

        // insert a Collection of Email objects
        EmailTable.insert(businessKey, contactID, emailList, connection);

        // select a Collection of Email objects by BusinessKey
        emailList = EmailTable.select(businessKey, contactID, connection);

        // delete a Collection of Email objects by BusinessKey
        EmailTable.delete(businessKey, connection);

        // re-select a Collection of Email objects by BusinessKey
        emailList = EmailTable.select(businessKey, contactID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

  }

  public static void test(Connection connection)
    throws Exception
  {
    Transaction txn = new Transaction();

    KeyedReference keyedRef = new KeyedReference();
    keyedRef.setTModelKey("");
    keyedRef.setKeyName("");
    keyedRef.setKeyValue("");

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        FindRelatedBusinessQuery.select("2a33d7d7-2b73-4de9-99cd-d4c51c186bce",connection);
        FindRelatedBusinessQuery.selectWithKeyedRef("2a33d7d7-2b73-4de9-99cd-d4c51c186bce",keyedRef,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here

    keysIn.add("901b15c5-799c-4387-8337-a1a35fceb791");
    keysIn.add("80fdae14-0e5d-4ea6-8eb8-50fde422056d");
    keysIn.add("e1996c33-c436-4004-9e3e-14de191bcc6b");
    keysIn.add("3ef4772f-e04b-46ed-8065-c5a4e167b5ba");

    Transaction txn = new Transaction();

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        FindTModelByCategoryQuery.select(categoryBag,keysIn,null,connection);
        FindTModelByCategoryQuery.select((KeyedReference)keyedRefVector.elementAt(0),null,null,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector keyRefs = new Vector();
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "blah, blah, blah"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "Yadda, Yadda, Yadda"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "WhoobWhoobWhoobWhoob"));
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "Haachachachacha"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a Collection of new Category KeyedReference objects
        BusinessCategoryTable.insert(businessKey, keyRefs, connection);

        // insert another new BusinessEntity
        business.setBusinessKey(uuidgen.uuidgen());
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert another Collection of new Category KeyedReference objects
        BusinessCategoryTable.insert(
          business.getBusinessKey(),
          keyRefs,
          connection);

        // select a Collection of Category KeyedReference objects
        keyRefs = BusinessCategoryTable.select(businessKey, connection);

        // delete a Collection of Category KeyedReference objects
        BusinessCategoryTable.delete(businessKey, connection);

        // re-select a Collection of Category KeyedReference objects
        keyRefs = BusinessCategoryTable.select(businessKey, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        String serviceKey = uuidgen.uuidgen();
        BusinessService service = new BusinessService();
        service.setBusinessKey(businessKey);
        service.setServiceKey(serviceKey);

        String bindingKey = uuidgen.uuidgen();
        BindingTemplate binding = new BindingTemplate();
        binding.setServiceKey(serviceKey);
        binding.setBindingKey(bindingKey);
        binding.setAccessPoint(
          new AccessPoint("http://www.juddi.org/bindingtemplate.html", "http"));

        Vector infoList = new Vector();
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        int infoID = 0;

        Vector descList = new Vector();
        descList.add(new Description("blah, blah, blah", "en"));
        descList.add(new Description("Yadda, Yadda, Yadda", "it"));
        descList.add(new Description("WhoobWhoobWhoobWhoob", "cy"));
        descList.add(new Description("Haachachachacha", "km"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new BusinessService
        BusinessServiceTable.insert(service, connection);

        // insert a new BindingTemplate
        BindingTemplateTable.insert(binding, connection);

        // insert a Collection of TModelInstanceInfo objects
        TModelInstanceInfoTable.insert(bindingKey, infoList, connection);

        // insert a Collection of Description objects
        InstanceDetailsDescTable.insert(
          bindingKey,
          infoID,
          descList,
          connection);

        // select the Collection of Description objects
        descList =
          InstanceDetailsDescTable.select(bindingKey, infoID, connection);

        // delete the Collection of Description objects
        InstanceDetailsDescTable.delete(bindingKey, connection);

        // re-select the Collection of Description objects
        descList =
          InstanceDetailsDescTable.select(bindingKey, infoID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try
        {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex)
        {
          sqlex.printStackTrace();
        }
View Full Code Here

    }
  }

  public static void test(Connection connection) throws Exception
  {
    Transaction txn = new Transaction();
    UUIDGen uuidgen = UUIDGenFactory.getUUIDGen();

    if (connection != null)
    {
      try
      {
        String authorizedUserID = "sviens";

        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector contactList = new Vector();
        Contact contact = new Contact("Bill Bob");
        contact.setUseType("server");
        contactList.add(contact);
        int contactID = 0;

        Vector addrList = new Vector();
        Address address = null;

        address = new Address();
        address.setUseType("Mailing");
        address.setSortCode("a");
        addrList.add(address);

        address = new Address();
        address.setUseType("Shipping");
        address.setSortCode("b");
        addrList.add(address);

        address = new Address();
        address.setUseType("Marketing");
        address.setSortCode("c");
        addrList.add(address);

        address = new Address();
        address.setUseType("Sales");
        address.setSortCode("d");
        addrList.add(address);

        address = new Address();
        address.setUseType("Engineering");
        address.setSortCode("e");
        addrList.add(address);

        // begin a new transaction
        txn.begin(connection);

        // insert a new BusinessEntity
        BusinessEntityTable.insert(business, authorizedUserID, connection);

        // insert a new Contact
        ContactTable.insert(businessKey, contactList, connection);

        // insert a Collection of Address objects
        AddressTable.insert(businessKey, contactID, addrList, connection);

        // select the Collection of Address objects
        addrList = AddressTable.select(businessKey, contactID, connection);

        // delete the Collection of Address objects
        AddressTable.delete(businessKey, connection);

        // re-select the Collection of Address objects
        addrList = AddressTable.select(businessKey, contactID, connection);

        // commit the transaction
        txn.commit();
      }
      catch (Exception ex)
      {
        try {
          txn.rollback();
        }
        catch (java.sql.SQLException sqlex) {
          sqlex.printStackTrace();
        }
View Full Code Here

    keysIn.add("13411e97-24cf-43d1-bee0-455e7ec5e9fc");
    keysIn.add("3f244f19-7ba7-4c3e-a93e-ae33e530794b");
    keysIn.add("3009f336-98c1-4193-a22f-fea73e79c909");
    keysIn.add("3ef4772f-e04b-46ed-8065-c5a4e167b5ba");

    Transaction txn = new Transaction();

    if (connection != null)
    {
      try
      {
        // begin a new transaction
        txn.begin(connection);

        FindServiceByTModelKeyQuery.select(businessKey,tModelBag,keysIn,null,connection);
        FindServiceByTModelKeyQuery.select(businessKey,tModelBag,null,null,connection);

        // commit the transaction
        txn.commit();
      }
      catch(Exception ex)
      {
        try { txn.rollback(); }
        catch(java.sql.SQLException sqlex) { sqlex.printStackTrace(); }
        throw ex;
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.util.jdbc.Transaction

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.