Package org.apache.juddi.util.jdbc

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


  */
  public void beginTrans()
    throws org.apache.juddi.error.RegistryException
  {
    try {
      this.transaction = new Transaction();
      this.transaction.begin(connection);
    }
    catch(SQLException sqlex) {
      throw new RegistryException(sqlex);
    }
View Full Code Here


  */
  public void beginTrans()
    throws org.apache.juddi.error.RegistryException
  {
    try {
      this.transaction = new Transaction();
      this.transaction.begin(connection);
    }
    catch(SQLException sqlex) {
      throw new RegistryException(sqlex);
    }
View Full Code Here

    keysIn.add("uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4");
    keysIn.add("uuid:CD153257-086A-4237-B336-6BDCBDCC6634");
    keysIn.add("uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384");
    keysIn.add("uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E");

    Transaction txn = new Transaction();

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

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

    try
    {
      String businessKey = uuidgen.uuidgen();
      BusinessEntity business = new BusinessEntity();
      business.setBusinessKey(businessKey);
      business.setAuthorizedName("Steve Viens");
      business.setOperator("www.jUDDI.org");

      String publisherID = "sviens";

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

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

      // select one of the BusinessEntity objects
      business = BusinessEntityTable.select(businessKey,connection);

      // delete that BusinessEntity object
      //BusinessEntityTable.delete(businessKey,connection);

      // re-select that BusinessEntity object
      business = BusinessEntityTable.select(businessKey,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);

        Vector keys = null;

        keys = FindBindingByCategoryQuery.select(serviceKey,categoryBag,keysIn,null,connection);
        System.out.println(keys.size());

        keys = FindBindingByCategoryQuery.select(serviceKey,(KeyedReference)keyedRefVector.elementAt(0),null,null,connection);
        System.out.println(keys.size());

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

        FindBusinessByCategoryQuery.select(categoryBag,keysIn,null,connection);
        FindBusinessByCategoryQuery.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");

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

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

        String authorizedUserID = "sviens";

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

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

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

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

        // select a BusinessService object
        service = BusinessServiceTable.select(serviceKey,connection);

        // delete a BusinessService object
        BusinessServiceTable.delete(serviceKey,connection);

        // select a BusinessService object
        service = BusinessServiceTable.select(serviceKey,connection);

        // select a Collection BusinessService objects by BusinessKey
        BusinessServiceTable.selectByBusinessKey(businessKey,connection);

        // delete a Collection BusinessService objects by BusinessKey
        BusinessServiceTable.deleteByBusinessKey(businessKey,connection);

        // select a Collection BusinessService objects by BusinessKey
        BusinessServiceTable.selectByBusinessKey(businessKey,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("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);

        FindBusinessByTModelKeyQuery.select(tModelBag,keysIn,null,connection);
        FindBusinessByTModelKeyQuery.select(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
      {
        String businessKey = uuidgen.uuidgen();
        BusinessEntity business = new BusinessEntity();
        business.setBusinessKey(businessKey);
        business.setAuthorizedName("sviens");
        business.setOperator("WebServiceRegistry.com");

        Vector urlList = new Vector();
        urlList.add(
          new DiscoveryURL("businessEntity", "http://www.steveviens.com/abc"));
        urlList.add(
          new DiscoveryURL("businessEntity", "http://www.steveviens.com/def"));
        urlList.add(
          new DiscoveryURL(
            "businessEntityExt",
            "http://www.steveviens.com/ghi"));
        urlList.add(
          new DiscoveryURL(
            "businessEntityExt",
            "http://www.steveviens.com/jkl"));

        String authorizedUserID = "sviens";

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

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

        // insert a Collection DiscoveryURL objects
        DiscoveryURLTable.insert(businessKey, urlList, connection);

        // select a Collection DiscoveryURL objects by BusinessKey
        urlList = DiscoveryURLTable.select(businessKey, connection);

        // delete a Collection DiscoveryURL objects by BusinessKey
        DiscoveryURLTable.delete(businessKey, connection);

        // re-select a Collection DiscoveryURL objects by BusinessKey
        urlList = DiscoveryURLTable.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("mleblanc");
        business.setOperator("XMLServiceRegistry.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/tmodelinstanceinfo.html",
            "http"));

        Vector infoList = new Vector();
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));
        infoList.add(new TModelInstanceInfo(uuidgen.uuidgen()));

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

        // select a Collection of TModelInstanceInfo objects (by BindingKey)
        infoList = TModelInstanceInfoTable.select(bindingKey, connection);

        // delete a Collection of TModelInstanceInfo objects (by BindingKey)
        TModelInstanceInfoTable.delete(bindingKey, connection);

        // re-select a Collection of TModelInstanceInfo objects (by BindingKey)
        infoList = TModelInstanceInfoTable.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

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.