Example usage for com.mongodb.client MongoCursor next

List of usage examples for com.mongodb.client MongoCursor next

Introduction

In this page you can find the example usage for com.mongodb.client MongoCursor next.

Prototype

@Override
    TResult next();

Source Link

Usage

From source file:com.mycompany.mavenproject2.SelectBrandController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /*  String qry="select name from brand_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){                /*  w  ww . ja v a2s . co m*/
       List.getItems().addAll(rs.getString("name"));
    }*/
    MongoCursor<Document> cursor4 = col.find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");

            List.getItems().addAll(rs);

        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.SelectCatController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /*  String qry="select name from category_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){/*from  w  w  w.  ja va  2s  .  c om*/
                
       List.getItems().addAll(rs.getString("name"));
    }*/
    MongoCursor<Document> cursor4 = col.find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");

            List.getItems().addAll(rs);

        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.SelectDeptController.java

public void update() {

    /*Stage stage=new Stage();
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("AddDept.fxml"));
    Parent root4=(Parent) fxmlLoader.load();
    AddDeptController controller=fxmlLoader.<AddDeptController>getController();
    stage.setScene(new Scene(root4));/*from  w  w w. j a  v  a  2s  . c om*/
    System.out.println("dept name entered is "+ controller.getData());
    List.getItems().add("Hello");*/
    /*String qry="select name from dept_detail";
    java.sql.Connection conn=Connection.getConnect();
            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){
        List.getItems().addAll(rs.getString("name"));               
    }*/
    MongoCursor<Document> cursor4 = col.find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");

            List.getItems().addAll(rs);

        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.SelectDeptController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    /*   List<String> values = Arrays.asList("one", "two", "three");
    list.setItems(FXCollections.observableList(values));*/

    /*    String qry="select name from dept_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){                //from  ww w.j a v  a2s .  c  o  m
       List.getItems().addAll(rs.getString("name"));
    }*/

    MongoCursor<Document> cursor4 = db.getCollection("DeptDetail").find().iterator();
    try {
        while (cursor4.hasNext()) {
            String rs = cursor4.next().getString("Name");
            List.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.SelectLocationController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /*    String qry="select name from location_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){//from  www  .  j a  v  a2 s .  c  om
                
       List.getItems().addAll(rs.getString("name"));
    }*/

    MongoCursor<Document> cursor4 = db.getCollection("LocationDetail").find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");
            List.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }
}

From source file:com.mycompany.mavenproject2.SelectPackController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /* String qry="select name from pack_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){//from w w w  .j  av a  2 s .  c o  m
                
       List.getItems().addAll(rs.getString("name"));
    }*/

    MongoCursor<Document> cursor4 = col.find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");
            List.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }
}

From source file:com.mycompany.mavenproject2.SelectSizeController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /*String qry="select name from size_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){//from  w  w  w  .  j  a v  a2 s  . co  m
                
       List.getItems().addAll(rs.getString("name"));
    }*/
    MongoCursor<Document> cursor4 = col.find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");
            List.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.SelectUOMController.java

@Override
public void initialize(URL url, ResourceBundle rb) {

    /*String qry="select name from uom_detail";
    java.sql.Connection conn=Connection.getConnect();            
    PreparedStatement pst2=conn.prepareStatement(qry);
    ResultSet rs = pst2.executeQuery(qry);
    while(rs.next()){/*  ww w .  j a va2 s  . c  o m*/
                
       List.getItems().addAll(rs.getString("name"));
    }*/
    MongoCursor<Document> cursor4 = db.getCollection("UOMDetail").find().iterator();
    try {
        while (cursor4.hasNext()) {

            String rs = cursor4.next().getString("Name");
            List.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }

}

From source file:com.mycompany.mavenproject2.ShortcutController.java

@Override
public void initialize(URL url, ResourceBundle rb) {
    MongoCursor<Document> cursor4 = db.getCollection("PackDetail").find().iterator();
    try {/*from  w w w.j  av  a 2s.c om*/
        while (cursor4.hasNext()) {
            String rs = cursor4.next().getString("Name");
            PackCombo.setValue(rs);
            PackCombo.getItems().addAll(rs);
        }
    } finally {
        cursor4.close();
    }
}

From source file:com.mycompany.mavenproject2.TenderAddController.java

public void EditButton(String Desc, String Type) throws URISyntaxException, IOException {
    GlobalFlag = 1;//from w w  w.  ja  v  a2s. c o m
    TenderName.setText(Desc);
    sort2 = new BasicDBObject();
    sort2.put("TenderName", Desc);
    MongoCursor<Document> cursor = col.find(sort2).iterator();
    while (cursor.hasNext()) {
        Document dr = cursor.next();
        PID = dr.getInteger("ID");
        PaymentCombo.setValue(dr.getString("PaymentMode"));
        ERRate.setText(dr.getString("ExchangeRate"));
        ConvRate.setText(dr.getString("ConversionRate"));
        CurSymbol.setText(dr.getString("Currency"));
        MinPayAmount.setText(dr.getString("MinPayAmount"));
        NoteText.setText(dr.getString("Notes"));
        if (!dr.getString("Image").equalsIgnoreCase("")) {
            Path get = Paths.get(dr.getString("Image"));
            byte[] readAllBytes = Files.readAllBytes(get);
            Image convertToJavaFXImage = convertToJavaFXImage(readAllBytes, 1024, 768);

            imageLabel.setImage(convertToJavaFXImage);
        }
        if (dr.getInteger("AuthenticationCheck") == 1) {
            AuthenticationCheck.setSelected(true);
        } else {
            AuthenticationCheck.setSelected(false);
        }
    }
}