• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JayBird / Firebird nullpointerexception when using getInt()

 
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Does anyone have any experiance with Jaybird? I am trying to use the resultSet.getInt("columnName") method to set an int object. Code :



the column name is correct, I checked it, rechecked it and rechecked it yet again. If I take out the int tax line, I have the same issues the next time I use the getInt() for amount and income. Any hints as to what Im doing wrong?

Greg
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should definitely not get a NullPointerException when calling getInt. If the database value is null getInt should return 0 (required by the ResultSet API), and if the column doesn't exist it should throw an SQLException, not a NullPointerException. Which driver are you using? Is it the latest version?
 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is the latest download, 2.1.6. I am at a bit of a loss as to what I should do. .getFetchSize returns 0 although FlameRobin shows that the size should come out as 2. I use the same code, and it works in the FlameRobin front end (where I test all of my statements before wiring them into my DBController class. I've even gone so far as to copy and past it, Ive shut down the server and restarted it to garantee that there was no back ground error. I dont know what Im screwing up.
 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved. Stupid errors only. It was fixed when joined two tables together and accessed the database once rather than trying to access it a second time while already reading from it. The nullpointer exception was caused by my own stupidity. It is now fixed.
 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
reply
    Bookmark Topic Watch Topic
  • New Topic