Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:03:13+00:00 2026-06-07T10:03:13+00:00

How can I retrieve MongDB data and load in textboxes using javadriver? I tried

  • 0

How can I retrieve MongDB data and load in textboxes using javadriver?

I tried the following code to show data, but I want to get the data in textboxes:

BasicDBObject doc = new BasicDBObject();
doc.put("Name", v2);
doc.put("SID", n4);
doc.put("University", v4);
DBCursor Cur = coll.find(doc);   
System.out.println(Cur);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:03:17+00:00Added an answer on June 7, 2026 at 10:03 am

    The following code fragment shows how to extract the individual fields of a document when you iterate over the results of a query. You could, if you wanted, take each field and put it in a textbox of a GUI.

    The complete code sample is here: https://gist.github.com/3087822

    private static void queryAndDisplayStudents(DBCollection students)
    {
        // Get all students (no query criteria).
        DBCursor cursor = students.find();
    
        // Iterate over the students.
        while (cursor.hasNext()) 
        {
            // Display each student.
    
            DBObject student = cursor.next();
    
            // Get the individual fields of the student document.
            // These individual fields could, for example, 
            // be put in text fields of a GUI.
            String name = (String) student.get("Name");
            Number sid  = (Number) student.get("SID");
            String university = (String) student.get("University");
    
            // Given that we are not actually building a GUI, 
            // just display the fields on the command line.
            System.out.printf("Student name: %s, SID: %d, University: %s%n", 
                              name, sid, university);
        }        
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How I can retrieve data from the SUM(total) field? The following code does not
I know that I can retrieve session by using item.fields.name but what if I
I can retrieve a Cookie value by: <?php $cookie=$_COOKIE[cookieName]; ?> Now i want to
I know I can retrieve some settings.xml parameters using properties, like, for example ${settings.localRepository}
I developp a Java application using Windows Desktop Search from which I can retrieve
I can retrieve the xaml with rtb.xaml.ToString() and store it in a database. But
I've been charged with creating a simple data source so clients can retrieve a
I know you can retrieve the username with something like System.getProperty(user.name) but I am
I know that you can retrieve events for a specified date range, but how
I want to retrieve the last inserted _id , using mongoose as MongoDB wrapper

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.