Package com.intersys.gds

Examples of com.intersys.gds.Connection


   
  }
  public static void main(String args[]){
    int documentCount = 100;
    //1. Connect to GlobalsDB
    Connection connection = new Connection();
    connection.connect();
   
    //2. Generate test data
    List<Document> worldJugs = new ArrayList<Document>();
    Document jug = null;
    Document location = null;
    for(int i=0; i<documentCount ; i++){
      jug = new Document();
      jug.put("jugVisit-" + i, new String("Date: " + Calendar.getInstance().getTime()));
      location = new Document();
      location.put("country", "(Axis-Of-Evil) - " + i);
      location.put("venue", "Hotel-" + i*3);
      jug.put("location", location);
      worldJugs.add(jug);
    }
    //3 TODO: Without schema you will get nulls instead of Exceptions.  Add exception/error notification.
    Document firstJUG = worldJugs.get(0);
    DocumentType jugType = DocumentType.createDocumentType("WorldJUGs", firstJUG);
    jugType.setReference("location", ElementType.TYPE_REFERENCE, "Location", "country");
    connection.saveDocumentType(jugType);
   
    Document jugLocation = (Document) firstJUG.get("location");
    DocumentType locationType = DocumentType.createDocumentType("Location", jugLocation);
    locationType.setReference("venue", ElementType.TYPE_BACK_REFERENCE, "WorldJUGs", "NONE");
    connection.saveDocumentType(locationType);
   
    //4.Create the db object handle
    DocumentMap dbDocHandle = connection.getDocumentMap("WorldJUGs");
   
    //5. Store the data in the database
    for(int j=0; j<documentCount; j++){
      Document ljug = worldJugs.get(j);
      dbDocHandle.store(Integer.toString(j), ljug);
    }
    //6. Close the connection
    connection.close();
  }
View Full Code Here


    * as well as creating the corresponding Document Maps.
    */
    void init(String[] args) {
        checkParameters(args);
        generateSampleData();
        connection = new Connection();
        connection.connect();
        deleteSchema();
        createSchema();
        benchmark = connection.getDocumentMap("Benchmark");
    }
View Full Code Here

    * connecting, generating sample Accounts and Customers data,
    * as well as creating the corresponding Document Maps.
    */
    void init(String[] args) {
        checkParameters(args);
        connection = new Connection();
        connection.connect();
        deleteSchema();
        createSchema();
        customers = connection.getDocumentMap("Customers");
    }
View Full Code Here

TOP

Related Classes of com.intersys.gds.Connection

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.