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

  • SEARCH
  • Home
  • 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 9183895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:54:53+00:00 2026-06-17T18:54:53+00:00

Possible Duplicate: How to Display next and previous records on clicking on next button

  • 0

Possible Duplicate:
How to Display next and previous records on clicking on next button in Java

I am trying to display records from my database to my gui application in JAVA. I tried to run the below code but then I am getting the exception that operation is not supported dont know whats wrong with it.

 private void bt_previousActionPerformed(java.awt.event.ActionEvent evt) {
        if(evt.getSource()==bt_previous){

            DBUtil util = new DBUtil();
               try {
                    Connection con = util.getConnection();
                   PreparedStatement stmt = con.prepareStatement("SELECT [box_no],[weight],[note_state],[dm_state],[1],[2],[5],[10],[20],[50],[100],[500],[1000] FROM [CNV].[dbo].[soil_det] where rm_id=?");
                    ResultSet rs;
                    String rm = tf_rm_id.getText().trim();

                    stmt.setLong(1, Long.parseLong(rm));

                    rs = stmt.executeQuery();

                    rs.getArray(WIDTH);
                    char n = WIDTH;
                    int i;
                    for (i=0; i<n; i++) {
                        String a = rs.getString("weight");
                        txtboxwgt.setText(a);
                        String b = rs.getString("note_state");
                        cbnotstat.setSelectedItem(b);
                        String c = rs.getString("dm_state");
                        cbdmnstat.setSelectedItem(c);
                        txtboxno.setText(rs.getString("box_no"));
                        txtRe1.setText(rs.getString("1"));
                        txtRs2.setText(rs.getString("2"));
                        txtRs5.setText(rs.getString("5"));
                        txtRs10.setText(rs.getString("10"));
                        txtRs20.setText(rs.getString("20"));
                        txtRs50.setText(rs.getString("50"));
                        txtRs100.setText(rs.getString("100"));
                        txtRs500.setText(rs.getString("500"));
                        txtRs1000.setText(rs.getString("1000"));
                    }

               } catch (Exception e) {
                         JOptionPane.showMessageDialog(null, e.getMessage());
                     }
        }


    }
  • 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-17T18:54:54+00:00Added an answer on June 17, 2026 at 6:54 pm

    You need to call ResultSet.next after the call to executeQuery:

    while (rs.next()) {
    ...
    

    PreparedStatement.executeQuery example

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Get next/previous ISO week and year in PHP I am trying to
Possible Duplicate: How to retrieve and display images from a database in a JSP
Possible Duplicate: What is best solution to get next and previous month from given
Possible Duplicate: C++ passing variables in from one Function to the Next. The Program
Possible Duplicate: C# Text don’t display on another form after double clicking an item
Possible Duplicate: how to pass variables from php page to javascript and display the
Possible Duplicate: display HTML page the same in Java forms I want to display
Possible Duplicate: iPhone: How to Display Underlined Text in a Button? underline text in
Possible Duplicate: Storing Smtp from email friendly display name in Web.Config I'm working on
Possible Duplicate: how to display data obtained from dao in jsp hi i able

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.