Package org.apache.juddi.util.jdbc

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


    idsIn = new Vector();
    idsIn.add(new String("sviens"));
    idsIn.add(new String("jdoe"));
    idsIn.add(new String("steveviens"));

    Transaction txn = new Transaction();

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

        Vector results = FindPublisherByNameQuery.select(name,idsIn,null,connection);
        if (results != null)
        {
          for (int i=0; i<results.size(); i++)
            System.out.println(i+": "+(String)results.elementAt(i));
        }

        FindQualifiers fqs = new FindQualifiers();
        fqs.sortByNameAsc = true;

        Vector resutls2 = FindPublisherByNameQuery.select(name,null,fqs,connection);
        if (results != null)
        {
          for (int i=0; i<resutls2.size(); i++)
            System.out.println(i+": "+(String)resutls2.elementAt(i));
        }

        fqs.exactNameMatch = true;

        Vector resutls3 = FindPublisherByNameQuery.select(name,null,fqs,connection);
        if (results != null)
        {
          for (int i=0; i<resutls3.size(); i++)
            System.out.println(i+": "+(String)resutls3.elementAt(i));
        }

        // 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");

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

        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 Collection of Description objects
        ServiceDescTable.insert(serviceKey, descList, connection);

        // select the Collection of Description objects
        descList = ServiceDescTable.select(serviceKey, connection);

        // delete the Collection of Description objects
        ServiceDescTable.delete(serviceKey, connection);

        // re-select the Collection of Description objects
        descList = ServiceDescTable.select(serviceKey, 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.setServiceKey(serviceKey);
        service.setBusinessKey(businessKey);

        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"));

        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 Collection of new Category KeyedReference objects
        ServiceCategoryTable.insert(serviceKey, keyRefs, connection);

        // insert another new BusinessService
        service.setServiceKey(uuidgen.uuidgen());
        BusinessServiceTable.insert(service, connection);

        // insert another Collection of new Category KeyedReference objects
        ServiceCategoryTable.insert(
          service.getServiceKey(),
          keyRefs,
          connection);

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

        // delete a Collection of Category KeyedReference objects
        ServiceCategoryTable.delete(serviceKey, connection);

        // re-select a Collection of Category KeyedReference objects
        keyRefs = ServiceCategoryTable.select(serviceKey, 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
      {
        OverviewDoc overviewDoc = new OverviewDoc();
        overviewDoc.setOverviewURL(
          "http://www.steveviens.com/overviewdoc.html");

        String tModelKey = uuidgen.uuidgen();
        TModel tModel = new TModel();
        tModel.setTModelKey(tModelKey);
        tModel.setAuthorizedName("sviens");
        tModel.setOperator("WebServiceRegistry.com");
        tModel.setName("Tuscany Web Service Company");
        tModel.setOverviewDoc(overviewDoc);

        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 TModel
        TModelTable.insert(tModel, authorizedUserID, connection);

        // insert a Collection of Description objects
        TModelDescTable.insert(tModelKey, descList, connection);

        // select the Collection of Description objects
        descList = TModelDescTable.select(tModelKey, connection);

        // delete the Collection of Description objects
        TModelDescTable.delete(tModelKey, connection);

        // re-select the Collection of Description objects
        descList = TModelDescTable.select(tModelKey, 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);

        FindBindingByTModelKeyQuery.select(serviceKey,tModelBag,keysIn,null,connection);
        FindBindingByTModelKeyQuery.select(serviceKey,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

    }
  }

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

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

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

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

        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 Description objects
        BindingDescTable.insert(bindingKey, descList, connection);

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

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

        // select the Collection of Description objects
        descList = BindingDescTable.select(bindingKey, 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("901b15c5-799c-4387-8337-a1a35fceb791");
    keysIn.add("80fdae14-0e5d-4ea6-8eb8-50fde422056d");
    keysIn.add("e1996c33-c436-4004-9e3e-14de191bcc6b");
    keysIn.add("f715d9ff-d4eb-4073-92e8-2411cd5d0d68");

    Transaction txn = new Transaction();

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

        FindTModelByIdentifierQuery.select(identifierBag,keysIn,null,connection);
        FindTModelByIdentifierQuery.select(identifierBag,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

    keysIn.add("901b15c5-799c-4387-8337-a1a35fceb791");
    keysIn.add("80fdae14-0e5d-4ea6-8eb8-50fde422056d");
    keysIn.add("e1996c33-c436-4004-9e3e-14de191bcc6b");
    keysIn.add("36f5d745-3be5-4e8f-8c1a-5f59a4c69070");

    Transaction txn = new Transaction();

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

        FindBusinessByDiscoveryURLQuery.select(discoveryURLs,keysIn,null,connection);
        FindBusinessByDiscoveryURLQuery.select(discoveryURLs,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 nameList = new Vector();
        nameList.add(new Name("SteveViens.com", "en"));
        nameList.add(new Name("EsephanoViens.com", "it"));
        nameList.add(new Name("AsdfJkl.com", "cy"));
        nameList.add(new Name("AsdfJkl.com"));

        String authorizedUserID = "sviens";

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

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

        // insert a Collection of Name objects
        BusinessNameTable.insert(businessKey, nameList, connection);

        // select the Collection of Name objects
        nameList = BusinessNameTable.select(businessKey, connection);

        // delete the Collection of Name objects
        //BusinessNameTable.delete(businessKey,connection);

        // re-select the Collection of Name objects
        nameList = BusinessNameTable.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 authorizedUserID = "sviens";

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

        Contact contact = new Contact();
        contact.setPersonNameValue("Bill Bob");
        contact.setUseType("server");

        Vector contactList = new Vector();
        contactList.add(contact);
        int contactID = 0;

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

        Vector addrList = new Vector();
        addrList.add(address);
        int addressID = 0;

        AddressLine addrLine1 = new AddressLine();
        addrLine1.setLineValue("SteveViens.com, Inc.");

        AddressLine addrLine2 = new AddressLine();
        addrLine2.setLineValue("PO BOX 6856");

        AddressLine addrLine3 = new AddressLine();
        addrLine3.setLineValue("78 Marne Avenue");

        AddressLine addrLine4 = new AddressLine();
        addrLine4.setLineValue("Portsmouth");

        AddressLine addrLine5 = new AddressLine();
        addrLine5.setLineValue("New Hampshire");

        Vector lineList = new Vector();
        lineList.add(addrLine1);
        lineList.add(addrLine2);
        lineList.add(addrLine3);
        lineList.add(addrLine4);
        lineList.add(addrLine5);

        // 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 new Address
        AddressTable.insert(businessKey,contactID,addrList,connection);

        // insert a Collection of AddressLine objects
        AddressLineTable.insert(businessKey,contactID,addressID,lineList,connection);

        // select the Collection of AddressLine objects
        lineList = AddressLineTable.select(businessKey,contactID,addressID,connection);

        // delete the Collection of AddressLine objects
        //AddressLineTable.delete(businessKey,connection);

        // re-select the Collection of AddressLine objects
        lineList = AddressLineTable.select(businessKey,contactID,addressID,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.