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 9185223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:14:03+00:00 2026-06-17T19:14:03+00:00

I get an error stating that I got an exception before start of a

  • 0

I get an error stating that I got an exception before start of a result set. I’m trying to get a value (score from the MySQL database) and add one to the Java rank based on the player score. This is to create a scoreboard.

So if the player’s score is lower than the current score, it gets posted with rank 1. If it’s higher, the program checks the score against the next entry in the MySQL database. I haven’t yet implemented a feature to change all the current entries rank’s to increment by 1.

Bottom Line: I’m creating a scoreboard using MySQL and Java. The Java program creates a score entry based on input, and then sends it off to the MySQL database.

      System.out.println("Your score is: "+score*2+"  (A lower score is better.)");
      try {
   // create a java mysql database connection
   String myDriver = "com.mysql.jdbc.Driver";
   String myUrl = "jdbc:mysql://4.30.110.246:3306/apesbridge2013";
   String dbName = "apesbridge2013";
   String tbName = period + "period";
   Class.forName(myDriver);
   Connection conn = DriverManager.getConnection(myUrl, "user", CENSORED);
   next = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
   ResultSet resultSet = next.executeQuery("SELECT * FROM " + tbName);
   int cscore = resultSet.getInt("score");
   for(int sscore = score; sscore > cscore;){
       resultSet.next();
       cscore = resultSet.getInt("score");
       rank++;
   }

   stmt = conn.createStatement();
   stmt.executeUpdate("insert into " + dbName + "." + tbName + " " + "values(" + rank + ", '" + name + "', " + score + ")");
   stmt.close();
   conn.close();
 }
 catch (Exception e)
 {
   System.err.println("Got an exception! ");
   System.err.println(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-17T19:14:03+00:00Added an answer on June 17, 2026 at 7:14 pm

    Put resultSet.next(); right below your executeQuery line.

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

Sidebar

Related Questions

I've got an app that records audio. i'm trying to get the filenames that
I got an error stating that the Site.master couldn't be found. Changed permissions on
In Visual Studio 2010 Pro, I get a compile error stating "expected an identifier"
What is the best way to get error messages from a WF4 workflow back
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I'm trying to make a program that: reads a list of Chinese characters from
okay the problem is that i got 2 codes one from the book i
I've got the following error: TemplateSyntaxError at /admin/results_cop/copsegmentresult/ Caught an exception while rendering: ('ascii',
I get error: ORA-06575: Package or function GET_CONC_NAMES is in an invalid state When
Why do I get error in this code?Even if i do not link but

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.