Examples of createCommand()


Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

        insert.setParameter(2, null);
        insert.setParameter(3, "5528 Wells Fargo Dr");
        insert.execute();

        // Verify
        Command select = das.createCommand("Select * from CUSTOMER where ID = 10");
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

    /**
     * Error by not setting a parameter
     */
    public void testDiltonsNullParameterBug2() throws Exception {
        DAS das = DAS.FACTORY.createDAS(getConnection());
        Command insert = das.createCommand("insert into CUSTOMER values (?, ?, ?)");
        insert.setParameter(1, Integer.valueOf(10));
        // insert.setParameterValue("LASTNAME", null);
        insert.setParameter(3, "5528 Wells Fargo Dr");

        try {
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

    /**
     * Set parameter to empty string
     */
    public void testDiltonsNullParameterBug3() throws Exception {
        DAS das = DAS.FACTORY.createDAS(getConnection());
        Command insert = das.createCommand("insert into CUSTOMER values (?, ?, ?)");
        insert.setParameter(1, Integer.valueOf(10));
        insert.setParameter(2, "");
        insert.setParameter(3, "5528 Wells Fargo Dr");
        insert.execute();

View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

        insert.setParameter(2, "");
        insert.setParameter(3, "5528 Wells Fargo Dr");
        insert.execute();

        // Verify
        Command select = das.createCommand("Select * from CUSTOMER where ID = 10");
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

     * null. I will try to duplicate with an insert since that is simpler
     *
     */
    public void testYingChen12162005() throws Exception {
        DAS das = DAS.FACTORY.createDAS(getConnection());
        Command insert = das.createCommand("insert into CUSTOMER values (?, ?, ?)");
        insert.setParameter(1, Integer.valueOf(10));
        insert.setParameter(2, "Williams");
        insert.setParameter(3, null);
        insert.execute();

View Full Code Here

Examples of org.apache.tuscany.das.rdb.DAS.createCommand()

        insert.setParameter(2, "Williams");
        insert.setParameter(3, null);
        insert.execute();

        // Verify
        Command select = das.createCommand("Select * from CUSTOMER where ID = 10");
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertNull(root.get("CUSTOMER[1]/ADDRESS"));

    }
View Full Code Here

Examples of org.eclipse.e4.core.commands.ECommandService.createCommand()

      parameters = new HashMap<String, Object>();
      for (MParameter mParm : modelParms) {
        parameters.put(mParm.getName(), mParm.getValue());
      }
    }
    ParameterizedCommand cmd = cmdService.createCommand(item.getCommand()
        .getElementId(), parameters);
    return cmd;
  }
 
  protected boolean canExecute(M item, IEclipseContext context) {
View Full Code Here

Examples of org.eclipse.emf.transaction.TransactionalEditingDomain.createCommand()

        Resource resource = eclass.eResource();
        ResourceSet resourceSet = resource.getResourceSet();
        TransactionalEditingDomain domain = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(resourceSet);
        try{
        if (domain != null){
          Command setCommand = domain.createCommand(SetCommand.class, new CommandParameter(eclass,
              EcorePackage.Literals.ENAMED_ELEMENT__NAME, newName));
          domain.getCommandStack().execute(setCommand);
          try {
            resource.save(Collections.emptyMap());
          } catch (IOException e) {
View Full Code Here

Examples of spark.api.Connection.createCommand()

  }
 
  public static void testQuery() throws Exception {
    DataSource myDS = new ProtocolDataSource("http://DBpedia.org/sparql");
    Connection conn = myDS.getConnection(NoCredentials.INSTANCE);
    Command query = conn.createCommand("SELECT ?p ?o WHERE { <http://dbpedia.org/resource/Terry_Gilliam> ?p ?o }");   
    Solutions solutions = query.executeQuery();
   
    showMetadata(solutions);
    logger.debug("vars = {}", solutions.getVariables());
    int row = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.