Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Error: ResultSet not open. Operation 'getInt' not permitted. Verify that autocommit is off.

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an app in NetBeans that displays and manages a database.

It was working great. However, I am now getting the following errors:



My app shows the first record but gives me an error dialog when I try the Next button.

I tried



it didn't help.

Then I tried checking the autocommit value before the SQL calls that cause the errors:



and this is what I'm getting:



On the face of it autocommit is off so what could be causing the issue?
 
Marshal
Posts: 25818
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would track down the person who wrote that error message and step on their toes firmly. Because the message leads to the belief that enabling autocommit has something to do with the fact that the ResultSet was closed in the wrong place. (Which seems extremely unlikely to me.) And then I would ignore that part of the message and examine the code to find out why the ResultSet is being closed before the getInt() method is called in that particular case.
 
Rosie Fairfield
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for replying.

I figured out the problem:

I was calling


instead of


where stmt is a Statement variable I use for all my querys.

Apparently, that's a bad idea lol
 
Master Rancher
Posts: 4665
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know why that works.
Because I for one don't, based on that error message...though the message itself is a little confused.
 
Rosie Fairfield
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually, the real problem was that I was using the same Statement variable for all my querys so I lost the results of one query each time I did another query
No wonder it couldn't find the records from the first query!!

I feel really stupid but at least my app is working just fine now
 
Dave Tolls
Master Rancher
Posts: 4665
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes much more sense...
 
It's a tiny ad only because the water is so cold.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic