Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Missing first row in SQL Result

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am querying a MySQL db for values to populate a jcombobox. The following query returns three items in SQL: mysql> select * from source;
+----+----------+
| id | name |
+----+----------+
| 1 | website |
| 2 | drive-by |
| 3 | referral |
+----+----------+
3 rows in set (0.00 sec)

When I run my code, I only get the second two. The first row is missing. I've checked a half dozen code examples online and they all look the same as mine. I'm using a while statement calling the next() method of the result set.




Here is the full method:

 
Chris Reed
Greenhorn
Posts: 10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seemed to have invented self-healing code??? I moved the whole try-catch block out of the button click method (which I was using to test it) and put it in the object properties in the "After All-set Code" to execute after the object has rendered (NetBeans interface) and it works.?!?!?! All three values are appearing in the drop down.
 
Sheriff
Posts: 4870
317
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you got it sorted Chris. Kudos for coming back and letting us know what you did to fix it
 
    Bookmark Topic Watch Topic
  • New Topic